I've also had this happen (by accident) after creating a new venv while inside an existing virtual environment. an easy way to diagnose this would be to see where the python
is symlinked to, i.e. run:
ls -l venv/bin/python
and make sure it points to the appropriate Python binary. For most systems this will be /usr/bin/python
or /usr/bin/python3
. while if it points to an existing virtual environment it'll be something like /home/youruser/somedir/bin/python
. if it's the latter than I'd suggest recreating the venv while making sure that you aren't "inside" any existing virtualenv (i.e. run deactivate
)