PyChram autocomplete for import library

Answered

 if I write the code below in python file(.py).

import numpy as np
import pandas as pd

test_df = pd.read_csv('testdata/testdata.csv')

and if i type 'pd.' or 'test_df.' and press ctrl+space button, anything show up.

I could I fix it?

 

16 comments

ctrl-space works for me. Have you checked your key map assignments?

0

Yeah. I check it already.

In the python code script isn't work

But in the console mode, it works

0

There is a yellow warning that no interpreter is configured. Add interpreter  in "Settings | Project | project Interpreter".

0

I added it. 

However, autocomplete still not works.

 

0

Have you tried to run "File | Invalidate caches"?

1

i am also having same trouble for other modules.

0

Hi Csai,

What kind of trouble? Screenshots are welcome.

0

Auto complete suggestion are coming on the console but not in the editor as mentioned by cjse3178

0

Do you use conda?

Try File | Invalidate Caches/Restart... to make PyCharm reindex your interpreter.

0

No i do not use conda
And i also tried File | Invalidate Caches/Restart but it didn't work

0

Please attach a screenshot of your Project Interpreter and another one which shows the problem in editor.

0

its not working in the editor.

 

only working in the python console.

0

Which package is it specifically? Would be great to see the whole script.

Also, what about Project Interpreter? Could you attach a screenshot of it?

0

I believe this is due to the fact that it is imported dynamically and PyCharm doesn't introspect it that deep while in Python Console the line is already executed and dynamic import is already performed.

Not sure if we can support such case, but feel free to submit a feature request about it to our issue tracker using the link https://youtrack.jetbrains.com/issues/PY

0

Please sign in to leave a comment.