Reputation: 4470
After many different ways of trying to install jupyter, it does not seem to install correctly.
May be MacOS related based on how many MacOS system python issues I've been having recently
pip install jupyter --user
Seems to install correctly
But then jupyter is not found
where jupyter
jupyter not found
Not found
Trying another install method found on SO
pip install --upgrade notebook
Seems to install correctly
jupyter is still not found
where pip
/usr/local/bin/pip
What can I do to get the command line jupyter notebook
command working as in the first step here: https://jupyter.readthedocs.io/en/latest/running.html#running
Upvotes: 5
Views: 14647
Reputation: 19328
Try solving this with Conda or Poetry.
Poetry makes it a lot easier to manage Python dependencies (including Jupyter) and build a virtual environment.
Here are the steps to adding Jupyter to a project:
poetry add pandas jupyter ipykernel
to add the dependencypoetry shell
to create a shell within the virtual environmentjupyter notebook
to to fire up a notebook with access to all the virtual environment dependenciesThe other suggested solutions are just band-aids. Conda / Poetry can give you a sustainable solution that's easy to maintain and will shield you from constant Python dependency hell.
Upvotes: 0
Reputation: 2025
My MacOS has python 2.7, I installed python3 with brew, then the following commands work for me
brew install python3
brew link --overwrite python
pip3 install ipython
python3 -m pip install jupyter
Upvotes: 2
Reputation: 8894
Short answer: Use python -m notebook
After updating to OS Catalina, I installed a brewed python: brew install python
.
It symlinks the Python3, but not the python
command, so I added to my $PATH
variable the following:
/usr/local/opt/python/libexec/bin
to make the brew python the default python command (don't use system python, and now python2.7 is deprecated). python -m pip install jupyter
works, and I can find the jupyter files in ~/Library/Python/3.7/bin/
, but the tutorial command of jupyter notebook
doesn't work. Instead I just run python -m notebook
.
Upvotes: 6
Reputation: 67
You need to add the local python install directory to your path. Apparently this is not done by default on MacOS.
Try:
export PATH="$HOME/Library/Python/<version number>/bin:$PATH"
and/or add it to your ~/.bashrc
.
Upvotes: 2