There are many solutions to this, some more convenient than others, and they don't always work.
Here's all you can try, going from 'quick' to 'annoying':
File
-> Invalidate Caches / Restart
and restart PyCharm.
Run
-> Edit Configurations
-> Configuration
-> Python Interpreter
.File
-> Settings
Project: [name]
-> Project Interpreter
-> 'Project Interpreter': Gear icon -> More...
File
-> Settings
Project: [name]
-> Project Interpreter
-> 'Project Interpreter': Gear icon -> More...
.idea
folder~/.PyCharm50
on Mac%homepath%/.PyCharm50
on WindowsIf you are using Docker, take note:
pip3
not pip
, especially with remote docker and docker-compose interpreters.PYTHONPATH
. More info here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000058690-Module-not-found-in-PyCharm-but-externally-in-Python .