I have a few projects in PyCharm, each with its own virtual environment.
Quite often, I add packages to these virtual environments using the CLI, mainly with python setup.py develop
from another local package.
The new package appear in Preferences -> Project -> Project Interpreter
and the calls to the newly-installed packages runs, but the imports still appear as erroneous, which drives me nuts:
How do I refresh the virtual environment
For PyCharm 2018.3.4, I solved this by verifying that the correct source locations are specified under File/Settings/Project::Project Structure. All of the valid source directories should be marked as "Sources" and the venv directory should marked as Excluded, at least that's what worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With