PyChram autocomplete for import library


 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?



The way to fix this issue is to go to File-->Settings-->Project Structure and select the folder with the import files and mark them as sources. At least it worked for me..


I am having the exact same issues outlined above. When will this be fixed??


Hello, please check this 

If it is not your case, please attach a simplified code and screenshots presenting the issue. 


Thank you. 


Same Problem here. Switched to Pycharm Professional 2020.1.3 and now facing this issue in exact same way as was described by others in this thread. All workarounds described in this thread do not work for me (invalidate cache, reassign interpreter, etc.) Autocompletion works in the console but does not work in the editor.

Is there a time line to fix it?

Thank you!


I am facing the same problem, I am getting okay in the python console. but I am not getting proper autosuggestion or autocompletion in the code editor. I tried to Try File > Invalidate caches / restart. I am not getting autosuggestion in the code editor.

for example,autocomplete works pandas

auto complete works at this level
I don't get autocomple "value_counts()" 

, on the other hand, autocomplete didn't work for pillow library. but it works in the python console. 

I tried with kite integration with spyder. this worked in the spyder Ide. unfortunately, I don't like spyder. would you give me a suggestion or fix it?



Make sure you use the latest PyCharm version (2020.1.4 at the moment) and if so, file an issue to our issue tracker providing code and steps for reproducing the problem.


Me too, i had the exact same issue as you guys having, are you guys had the issue solved yet already?


I have the same problem. Is there a solution?


Kahwoontan Viktor Crettenand

No solution apparently.

Sergey Karpov

This issue still seems to be popping up and not just with pandas.

I'm also getting it with the following:

from xml.dom import minidom

Then when I do `minidom.` I get nothing populating autocomplete.

Pretty annoying...

FYI, this is with PyCharm Pro 2020.2.1

EDIT: Upgraded to PyCharm Pro 2020.3.8 and it's still happening.


Seriously, why is this basic feature broken like this and for this long?

Do you know what does work? VS Code. Why does a free program work, but this does not? And please don't tell me "if VS Code works for you, then you should use it" because that doesn't change the fact that a basic feature that's been a part of IDEs since the 90s is not working correctly in PyCharm, and hasn't been working for literal years at this point.

Edit: Adding ticket...


Worked for me, just do as follow:

  1. Create empty project in pycharm.
  2. Add your files
  3. Add your import it will work

what made my case not working, is default popup of pycharm shows after installation, then i choose create project

i created the file after that, it was not working.

But when you do file new project, it will install bunch of things and will look as below

The case that not working looked like this


Permanently deleted user

I am not sure if it is the solution but I uninstalled Kite and disabled the plugging in Pycharm, did the File/Invalidate cache/Restart, closed and reopened the project and now the auto completion is working in the editor for pandas.


Same problem here, this time with numpy and pretty much every other import I've tried. This used to work, then stopped abruptly.

Invalidating caches didn't work.

Uninstalling and reinstalling the latest version of PyCharm didn't work.

Making a new project with a fresh python venv didn't work.

"Power Save Mode" is off. "Collect run-time types information for code insight" is on.

What happens:

What should happen (and what does happen, but only in the console):


Hello @Mem037!


Please upload your logs folder zipped from ***Help | Collect logs and Diagnostic Data***   to the FTP and please let me know the filename. 


Quite general steps to try: 

1. Create a new interpreter, test with different python versions

2. Try starting the IDE with default settings as described in


Antonina Belianskaya

While I know you were replying to another comment, I can tell you that this is happening to me with a fresh install of PyCharm on newly installed Windows desktops, with various versions of Python, including fresh installs of Anaconda and Python 3.7/3.8/3.9.



Hi David, 

Thank you for the details. To proceed with the investigation please submit an issue at , with logs folder zipped from ***Help | Collect logs and Diagnostic Data*** , screenshots presenting the behavior. 

Thank you in advance! 


Hi Antonina,

I tried resetting the IDE settings to default. That didn't help.

I've uploaded my logs folder.

Upload ID: 2021_02_22_2whfduS99sF6fFvy (file:

Thanks for looking into this.


Hello @Mem037,

Please try deleting the "Python-stubs" manually: 


If it does not help, please upload a fresh log bundle. Thank you! 


It is also worth trying a complete IDE re-installation, with deletion of all IDE related directories before


Hi Antonina,

I deleted the "Python-stubs" directory and then let PyCharm rebuild skeletons. It helped...a little bit. Here's what things look like now on my end:

Looks good! Let's try applying a function to Y and then asking PyCharm for code completion options on the result.

Oh. That's not good. Let's check the console to see what things should look like.

I uploaded my logs as requested.

Upload ID: 2021_03_13_UsCNtE9EgSV1BMbN (file:

Thanks for looking into this.


Hello Mem037,


Regrettably, this is a bug. I have submitted a ticket please follow it for updates. 


I apologize for the inconvenience. 


By the way the same issue has place in Microsoft Visual Studio. It also can't recognize pandas read_excel(....) result as a DataFrame and can't suggest autocomplete options. And it doesn't matter whether it is on python 3.6 or 3.9.

Temporary option is to initialize dataframe as df = pandas.DataFrame(pandas.read_excel(....))


I have the same issue with matplotlib.pyplot

Here is what I see in InteliJ and for comparison what is there in VS Code:


LulaSvob This is a known issue

I'm sorry for the inconvenience.


I am having the same problem with autocomplete not working on packages. Currently I just added the lxml package and am importing html. I am trying to use autocomplete and it is not working. I have tried to invalidate caches and restart and deleted the python_stubs thing. You can see the code below... when I type in tree. nothing shows up other than (not, par).


import requests
from lxml import html

cl_cat_url = ''

params = {
'access_key': '6c1b98133d719f0ab4ff6a6136c41b99',
'url': '',
# 'render_js' : 1,
# 'keep_headers' : 1,
'proxy_location' : 'us',

headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36',\
'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'en-US,en;q=0.9',
'Connection': 'keep-alive',
'Host': '',
'sec-ch-ua': '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
'sec-ch-ua-mobile': '?0',
'Sec-Fetch-Dest' : 'document',
'Sec-Fetch-Mode': 'navigate',
'Sec-Fetch-Site': 'none',
'Sec-Fetch-User': '?1',
'Upgrade-Insecure-Requests': '1',
api_result = requests.get('', params=params, headers=headers )
tree = html.fromstring(api_result.content)

cl_cat_title = tree.


I made a video of the described problem I also have with the latest version of PyCharm. As noted by others, auto-completion works in the Python Console but not in the UI.

This example is a simple import of an Excel file using the "openpyxl" package. We then attach a "sheet" in the file and try to auto-complete the "max_row" attribute of this sheet.

In this video you see that:
- In the UI, max_row can be auto-completed when it is called on ws1 object that is a reference to the first sheet in the file
- In the UI, max_row can't be auto-completed when called on the ws2 object that is a named reference to the sheet
- Using the Python Console, we see that the 2 previous tests perfectly work there, "max_row" can be auto-completed on the "ws2" object

So something is different regarding auto-completion in the terminal or in the UI.

I hope this illustrates the problem.



Have the same issue. None of the previous suggestions worked smh


The suggestion from Mrtonyy has fixed my issue:

'''The way to fix this issue is to go to File-->Settings-->Project Structure and select the folder with the import files and mark them as sources. At least it worked for me.'''


Switched to the following version and problem solved.
PyCharm 2022.1.4 (Community Edition)


This is still an issue. Currently using the latest version of PyCharm 2023.1 Professional Edition. Like the others, code completion from an import lib is not working correctly in the but is working better in the python console. I tried the adding sources from the Project Structure approach, but the lib im importing lives in the External Libraries and does not show in the Project Structure settings, so i cant set it as a source


Please sign in to leave a comment.