ModuleNotFoundError: No module named '...'

I am using a System Interpretor and when I install modules, they show up when I enter the Settings >> Project Interpretor menu, and I can import them succesfully outside of PyCharm, but when I call them in PyCharm, I always receive the ModuleNotFoundError. I have checked the paths that are being searched in my interpretor, and they contain and should find all of my modules, but for soem reason they do not. 

Comment actions Permalink

I am even able to import the modules succesfully when I am using the Python Console inside of PyCharm

Comment actions Permalink

Sounds like a similiar issue I have been seeing lately, but since you are working and installing everything in the system it shows up for you more.

I have a project with a virtual environment with a boatload of pypy modules.

What I have noticed recently is that i have to invalidate the cache, restart and then let it reindex it all (be patient, it can take a while if there are loads (under the File menu, Invalidate Caches)

The modules are there, but Pycharm will tell me that it can't find "X" or "X" is not installed sometimes. When it does I HAVE to do the above.

In general, you should set up a venv for each project, which limits that issue for me just to that one project, but it sounds like might be we are having the same issue. Actually, I keep on meaning to check if there is a bug report out.

Edit: Nothing I could find but I suck at Youtrack searching. Next time it happends, I'll try and grab more specifics and then maybe post it.


Please sign in to leave a comment.