Cannot open Jupyter Notebook in the new zsh shell in macOS
I recently upgraded to macOS Catalina and it prompted me to upgrade to the zsh shell. But now when I try to run jupyter notebook
, it says command not found. I tried looking for it in .bashrc
but .bashrc
does not exist. What do I do? I did pip install jupyter
on the home /Users/username and I am using python3.
Solution 1:
There is some additional configuration that you need to do to get it to work.
-
Open bash profile using the command:
open ~/.bash_profile
-
There’s a block of code the anaconda installer added to the end of the file. Copy that. It looks something like this
-
Open the
.zshrc
file:open ~/.zshrc
And paste the copied code to the end of the file and save it.
-
Restart the terminal:
source ~/.zshrc
Solution 2:
I have encountered the similar annoying problem and here is my one-line solution:
-
Open terminal and type:
brew install jupyter
-
If you haven't install
brew
on your Mac, please follow the instruction here: https://brew.sh//bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
-
Wait for around 10 minutes until the installation finishes and try
jupyter
again.
Explain:
It helps download a lot of "Catalina" related packages, like
==> Downloading https://homebrew.bintray.com/bottles/jupyterlab-2.1.5.catalina.bottle.tar.gz
......
==> Downloading https://homebrew.bintray.com/bottles/ipython-7.16.1.catalina.bottle.tar.gz
......
See https://github.com/dotnet/interactive/issues/34 for the latest discussions on this issue.