Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pycharm code autocomplete work only in python console but not on python file

I'm using pycharm IDE, and several libraries such as scikit-learn and pandas. For some reason, if I create a new python file and do:

import pandas as pd
import numpy as np
import matplotlib.pyplot as plot
pd.   #no auto complete here

right after i type pd. auto complete doesn't seem to work. I'm getting nothing. However, if i run a python console within PyCharm, and do similar thing above, the console would pop up an autocomplete window showing all the members of pd..

how do i get autocomplete to work on the main python file?

like image 454
user2773013 Avatar asked Sep 25 '14 16:09

user2773013


People also ask

Why Autocomplete is not working in PyCharm?

If code completion doesn't work, this may be due to one of the following reasons: The Power Save Mode is on (File | Power Save Mode).

How do I turn on autocomplete in Python?

Enter: enter edit mode. Shift+Enter: run cell, select below. Shift+Tab: signature autocompletion.

How do you autofill in Python?

(In Python Shell window, you can use TAB key besides the key combination of 'CTRL' and 'space' to invoke the built-in auto-completion feature.) Alternatively, you can choose the "Show Completions" in the main Edit menu to achieve the same as well.


1 Answers

I used to have this same problem. This was only happening for me in Linux. (I am using python 2.7)

I have since been able to fix it, I think what did it was defining the correct interpreter not only in the running/debugging configuration, but also in the defaults of the project (check File-->settings-->Project Interpreter and File-->default settings-->Project Interpreter)

I have now moved to the next problem, which is that auto-complete works for Python Console and File editing, but weirdly enough does not work for Debugging!...

like image 103
ntg Avatar answered Sep 21 '22 14:09

ntg