python virtualenv does not use correct version of python
If you want to change the PYTHONPATH
used in a virtualenv, you can add the following line to your virtualenv's django_python_2.7/bin/activate
file
export PYTHONPATH="/path/to/python"
export OLD_PYTHONPATH="$PYTHONPATH"
To restore to its original value on deactivate, you could add following line to your django_python_2.7/bin/postdeactivate
script.
export PYTHONPATH="$OLD_PYTHONPATH"
Otherwise, create new env
using
virtualenv -p /usr/bin/python2.7 django_python_2.7
I discovered the same problem...
and like @skyline75489 mentioned:
I forgot that i had stated an alias to my python3 executable a time ago.
I found it in my .bash files in my home directory and removed it.
Everything worked out fine again with my virtual environment.