I installed Python, pip3, and virtualenv as in this guide for TensorFlow:
brew install python
pip3 install -U virtualenv
Then I was able to create a virtual environment with:
virtualenv --system-site-packages -p python3 ./venv
Then I tried installing TensorFlow with
pip install --upgrade tensorflow
but it failed because TensorFlow is not yet compatible with Python 3.7. So I removed Python 3.7 with brew remove python
and installed 3.6.7 from an installer. But running the same virtualenv
command now fails:
$ virtualenv --system-site-packages -p python3 ./venv
-bash: /usr/local/bin/virtualenv: /usr/local/opt/python/bin/python3.7: bad interpreter: No such file or directory
$ which python3
/Library/Frameworks/Python.framework/Versions/3.6/bin/python3
So the virtualenv
link to the executable lists the newest Python version, even after removal.
Furthermore, virtualenv
lists brew
as the user group, which is also confusing:
$ ls -la /usr/local/bin/virtualenv
-rwxr-xr-x 1 user brew 232 29 Nov 17:06 /usr/local/bin/virtualenv
I've tried uninstalling virtualenv
with both pip
and pip3
and I get:
Skipping virtualenv as it is not installed.
How can I fix this issue?