After updating Ubuntu to the latest update, Pycharm tells me required packages are missing but the virtual environment is activated and the packages are all there.
Trying to runserver
results in ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
Trying to install packages again results in Invalid Python SDK
Anyone having this problem after the update? Thanks in advance.
EDIT:
Creating a new venv
seems to be a simply and fool-proof solution.
When using python3
it used the python at locate at /usr/bin/python3
instead of /venv/bin/python3
.
It behaves like the venv
isn't activated, while it actually is.
The venv directory in the project is immutate but it seems like Pycharm doesen't recognize it.
Looking at the interpreter seems like no package is installed or can be installed (both with gui or cli).
In the case this is a commonly experienced problem, please use this question for further investigations.
which python3
?<virtual-env-path>/bin/python3 manage.py runserver
?python3 -m pip --user virtualenv
packaging.python.org/en/latest/guides/…