44

I have installed anaconda on my MAC laptop, and tried to run jupyter notebook to install it, but I get error jupyter command not found.

Hai Vu
  • 37,849
  • 11
  • 66
  • 93
Ludwig
  • 1,401
  • 13
  • 62
  • 125
  • to be clear: `jupyter notebook` opens a notebook in the browser; it does not install jupyter. that should just come as part of anaconda installation. – Rick Sep 29 '16 at 20:51
  • 2
    Have you tried to restart the terminal so the new paths take effect? – Hai Vu Sep 29 '16 at 20:54

13 Answers13

46

You need to activate your conda environment (source bin/activate) and then do

$ pip install jupyter # Alternatively, you can do `conda install jupyter`
$ jupyter notebook # to actually run the notebook server
ffledgling
  • 11,502
  • 8
  • 47
  • 69
  • 3
    Is your conda environment activated? i.e did you do `source bin/activate` ? – ffledgling Sep 29 '16 at 20:58
  • 4
    source bin/activate - that was it! wasn't aware that I need to do that as well! thanks! – Ludwig Sep 29 '16 at 21:16
  • 2
    [This link](http://stackoverflow.com/questions/18675907/how-to-run-conda) talks about how to activate `conda`. TL;DR use `export PATH=~/anaconda2/bin:$PATH` after installing Anaconda – Adam M Thompson Mar 02 '17 at 19:09
  • @AdamMThompson If you do `source bin/activate` your path should be modified for you by that script. – ffledgling Mar 05 '17 at 14:57
  • 1
    You need to run that command from the anaconda folder (if you've downloaded and installed the package) – Nick Jun 08 '19 at 15:03
  • I am new to the macOS, anyone pls tell me how can I activate the anaconda. In the command prompt when I write conda --version it says command not found. how can i do that `source bin/activate` – Aadnan Farooq A Aug 22 '20 at 00:32
  • @AadnanFarooqA you need to install conda first. There are instructions on the official website on how to do so. If you get stuck there, please ask a new question with your problem. Link to install instructions - https://docs.conda.io/projects/conda/en/latest/user-guide/install/macos.html – ffledgling Sep 02 '20 at 04:32
  • If using conda, you should `conda install jupyter`, not pip – ldmtwo Oct 16 '20 at 16:49
  • 1
    Can you be more explicit? what is source bin/activate? – Marc Dec 11 '21 at 22:36
  • 1
    Thank you so much for this!!!! I was going nuts trying to figure out why I can't get jupyter to open – ML33M Apr 16 '23 at 10:56
20

Add $HOME/anaconda3/bin to your $PATH and jupyter-notebook should work. There are a ton of other binaries you can lookup in that folder as well.

export PATH=$HOME/anaconda3/bin:$PATH

then

jupyter-notebook
Chirag Arora
  • 877
  • 1
  • 9
  • 22
  • It may be installed into the opt folder now. I configured .zshrc with `export PATH=$HOME/opt/anaconda3/bin:$PATH` and can confirm jupyter-notebook now works. – Bart Schuijt Oct 28 '19 at 10:24
10

@ffledgling anwser did not work for me. What did solve was to install jupyter using conda:

conda install jupyter

That did the trick. Right after the installation finished I went with

jupyter notebook

as my next command and saw the server setup and the browser page opening.

Vitor Navarro
  • 171
  • 3
  • 6
3

I had this same problem on my Mac OS. I'm also new to Python, so forgive me if this is an obvious solution. What solved it for me was installing Python with the 'install for me only' option rather than the hard-drive option. If it tells you you can't, then reselect it. After that, the command jupyter notebook opened without a problem. Hope it can help someone!

How to

Installation Screenshot

Renats Stozkovs
  • 2,549
  • 10
  • 22
  • 26
Lisa Olson
  • 51
  • 1
  • 6
3

It could be as simple as opening a new Terminal window.

Olivier de Jonge
  • 1,454
  • 2
  • 15
  • 31
2

For Windows

After you can successfully run conda from powershell, you can install jupyter with:
conda install jupyter
command. Then re-open powershell and run
conda run jupyter notebook.

tufanlodos
  • 121
  • 1
  • 5
  • Thanks, All we need is to run cmdlets with conda prefix, in my case zsh:"jupyter notebook" "error:upyter notebook cmd could not found". Actual cmd: "conda run jupyter notebook" – cloudcop Feb 08 '22 at 16:33
1

If your issue is happening after running conda install jupyter, you can use conda init zsh to configure the ~/.zshrc automatically so that when you just type jupyter notebook on terminal, it can find it.

0

I ran into the same problem try this instead

jupyter-notebook
luii
  • 319
  • 3
  • 5
  • 16
0

I had the same issue on Mac. I am using Miniconda Opened ~/.zshrc profile on nano as, nano ~/.zshrc and added the location of miniconda on my mac as the last line of the ~/.zshrc as:

export PATH="/usr/local/Caskroom/miniconda/base/bin:$PATH"

solves the issue easily.

mjuarez
  • 16,372
  • 11
  • 56
  • 73
vigviswa
  • 157
  • 1
  • 8
0

Open a new terminal and try again, it worked for me. This is written somewhere in the installation guide "For this change to become active, you have to open a new terminal."

Simran Bhake
  • 117
  • 8
0

If it's a fresh installation. Close the the terminal and re-open

  • You don't have to install jupyter explicitly. Anaconda does for you.
  • Ensure the environment is activated first.
  • If you selected Yes when prompted "Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no]" during installation, prepend your commands with conda
  • mycomp@55:~$ conda activate
  • (base) mycomp@55:~$ jupyter notebook
7guyo
  • 3,047
  • 1
  • 30
  • 31
0

After installing Anaconda on windows 10, you can use Anaconda prompt from start menu to activate a conda enabled terminal window. You can run Jupyter from that window using:

jupyter notebook
Mohammad Fasha
  • 188
  • 1
  • 9
-1

You should first have conda in your PATH environment. You can achieve it taking a look on this answer.

Now you just need to run jupyter notebook.

Filipe
  • 149
  • 1
  • 7