Search code examples
pythonpippycharm

Successful install of `pip install -e` but all imports are flagged as errors in PyCharm


A package I developed named my_package that worked fine for over a year when installing using pip install -e, lately started to flag an error when importing it. The installation is successful and everything works fine at runtime but import my_package is flagged as No module named my_package in PyCharm. What can be the reason?


Solution

  • It's a fairly long-standing bug in PyCharm. One workaround is to mark your package as "Sources" manually in the "Project Structure" of your project's settings.