Just recently upgraded to Mac OSX Catalina, and it seems to have broken all my Python venv's.
- I have a venv that I previously created before upgrading to Catalina.
- I can activate the venv without issue:
source venv/bin/activate
- When I type
python
orpython3
, it actually runs the system Python interpreters, instead of the expected Python interpreter in my venv.
With my venv activated...
>>> which python
/usr/bin/python
>>> which python3
/usr/local/bin/python3
I expect that to point to /Users/<username>/<path-to-venv>/venv/bin/python3
.
- If I try to run that Python interpreter directly:
>>> /Users/<username>/<path-to-venv>/venv/bin/python3
bash: /Users/<username>/<path-to-venv>/venv/bin/python3: No such file or directory
- If I navigate to this venv directory in Finder, I can see that the
python3
file exists, although it's actually an alias. If I double-click on it, I get an error message that pops up that reads:The operation can't be completed because the original item for "Python3" can't be found.
So I think the way these venv's work is that they are based on references to existing Python interpreter installations. Evidently running a venv invokes these references, and if the original installation is broken it fails. I know that Catalina jacked with the default Python settings and went so far as to change installation directories.
Has anyone else encountered this? Can anyone offer tips to fix this? This seems to affect all my venv virtual environments across my system.