Since updating my Python using Homebrew
jupyter --version
gives
-bash: /usr/local/bin/jupyter: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory
which makes some sense, since there's no longer a Python at /usr/local/.../python2.7
. But I don't see any way to repair this.
Prior to updating Python, I there was a Python there, and the Homebrew's symlinked python
pointed there, but now which -a python
gives
/usr/local/opt/python@2/libexec/bin/python
/usr/local/bin/python
/usr/bin/python
which corresponds to what I want, and are, respectively
PATH
I've also brew link --overwrite --force python2
for good measure, but this has no effect.
How do I get jupyter
to find and use the Python 2.7 on my PATH
?
Works for me, its just to link Jupiter with the correct Python version.
rm '/usr/local/bin/jupyter'
brew link --overwrite jupyter
brew link --overwrite --dry-run jupyter
brew unlink jupyter && brew link jupyter
Homebrew moved the Python 2 to be keg-only, using the python@2
formula. The jupyter
formula has been updated accordingly, please upgrade it:
brew update && brew upgrade jupyter
Note that the Python 2 binary is now only available as python2
, the python
binary, if installed by Homebrew, is Python 3.
If you installed it with pip, link the Python 2 binary and re-install jupyter using pip2
:
brew link -f python@2
/usr/local/bin/pip2 install -U jupyter
You'll end up with a /usr/local/bin/jupyter
file that starts with the line #!/usr/local/opt/python@2/bin/python2.7
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With