Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MacOS Python 3.7 virtualenv fails?

My system is running MacOS and Homebrew and it recently updated to Python 3.7.

Now, just creating a new virtualenv and trying to use it fails.

FYI, I don't actually need Python 3.7. I didn't upgrade on purpose. I'd prefer the latest stable, supported version, but of course, I want the basics working.

➜  rm -rf ~/.virtualenvs/test
➜  python3 -m venv ~/.virtualenvs/test
➜  vex --path ~/.virtualenvs/test python
zsh: /usr/local/bin/vex: bad interpreter: /usr/local/opt/python/bin/python3.6: no such file or directory

➜  python3
Python 3.7.0 (default, Jun 29 2018, 20:13:13) 
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
like image 212
clay Avatar asked Feb 28 '26 17:02

clay


1 Answers

/usr/local/bin/vex file has this as the first line: #!/usr/local/opt/python/bin/python3.6; it's called shebang and it points operating system to the interpreter to run the script. You've uninstalled python3.6 so OS cannot find said interpreter. You need to reinstall vex with python3.7.

like image 121
phd Avatar answered Mar 02 '26 05:03

phd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!