Reputation: 481
I tried to use jupyter notebook with kernel python3, but I got this error message.
anonymous$ jupyter notebook
/usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory
Information about python and pip installed on mac (i used pip3 to install jupyter ):
anonymous$ which -a python python2 python2.7 python3 python3.6
/usr/bin/python
/usr/bin/python2.7
/usr/local/bin/python3
/usr/local/bin/python3.6
anonymous$ which -a pip pip2 pip3
/usr/local/bin/pip
/usr/local/bin/pip3
Tried to solve it with "brew update && brew upgrade jupyter" as the other post suggested but did not work. Got an error message saying that "Error: jupyter not installed".
Upvotes: 24
Views: 31625
Reputation: 494
I faced the same and I tried $brew install jupyter
as suggested here. But it gave me this error -
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.
As M1 Mac user this solved the issue finally -
arch -arm64 brew install jupyter
Upvotes: 1
Reputation: 61
This problem usually occurs when the kernel for jupyter notebooks is being loaded from a previous python version that might not exist anymore.
jupyter kernelspec list
. kernel.json contains the path to the python version in use. You can either change this path directly, or nuke the Jupyter install (as follows) and reinstall it.rm -rf /Users/<username>/Library/Jupyter/
)brew uninstall jupyter; brew cleanup
pip install jupyterlab
otherwise brew install jupyter
Upvotes: 5
Reputation: 1
It looks like "pip3" installs jupyter with the same Python version in the kernel and the one being used in the notebook.
pip3 install jupyter
jupyter notebook
Upvotes: 0
Reputation: 255
As of October 2020, @teresa 's solution worked for me.
I have to run pip3 to install devices, you can check which command for pip you need to use by running
pip -v
and if you get nothing, try pip3 -v
Depending one which one worked, enter:
pip3 install jupyter
jupyter notebook
Upvotes: 0
Reputation: 61
I reinstalled jupyter notebook with pip3 and everything worked fine when I treid to lauch the notebook again.
pip3 install jupyter
jupyter notebook
Upvotes: 6
Reputation: 6920
I faced the same error when I was using jupyter in a virtual environment. This was when I switched from homebrew
's python to the OS's python3.
All I had to do was rm /usr/local/bin/jupyter-lab
and then run jupyter-lab
Upvotes: 1
Reputation: 13458
You must have installed jupyter with another package manager such as pip
. You can try pip uninstall jupyter
followed by brew install jupyter
.
If you get the message:
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/jupyter
Target /usr/local/bin/jupyter already exists.
You can try brew link --overwrite jupyter
as suggested.
Upvotes: 28