Reputation: 483
after the upgrade to Monterey virtualenvwrapper doesn't behave. I've tried uninstalling it and re-installing it, deleting the old workspaces.
when I launch the mkvirtualenv this happens:
Using base prefix '/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7'
New python executable in /venvdir/venvname/bin/python3.7
Also creating executable in /venvdir/venvname/bin/python
ERROR: The executable /venvdir/venvname/bin/python3.7 is not functioning
ERROR: It thinks sys.prefix is '/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7' (should be 'my-project-dir/')
ERROR: virtualenv is not compatible with this system or executable
whatever version of Python it's trying to use, from Cellar, is not working?
in my ~/.bash_profile there is:
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/someworkspace
source /usr/local/bin/virtualenvwrapper.sh
why is the python version is taken from "Cellar" rather than from VIRTUALENVWRAPPER_PYTHON.
Another interesting this is that if I just run
python3 --version
Python 3.7.3
But I thought Monterey was using 3.8.9?
Does anyone know what has changed? Thanks T.
EDIT: small update, I've rewritten the question since I had another problem which was solved by restarting. The python version problem still remains.
Upvotes: 4
Views: 1544
Reputation: 175
I edited my file ~/.zprofile and changed the export:
export VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7
restarted the terminal and I was able to create the virtualenvs again.
Upvotes: 1