notebook icon indicating copy to clipboard operation
notebook copied to clipboard

'notebook' is not a Jupyter command

Open fehiepsi opened this issue 11 years ago • 40 comments

I keep getting this error 'notebook' is not a Jupyter command when trying to make a launcher (in Linux Mint mate panel) for jupyter notebook. The command I put in the launcher is /home/fehiepsi/miniconda3/bin/jupyter notebook. If I replace jupyter by ipython, then things go well. So I guess that the command jupyter notebook is different to ipython notebook, isn't it?

I install ipython notebook by using conda and just install jupyter today (of course, I have updated all packages). Could anyone please give me some suggestions?

Additional informaltion: I just run jupyter notebook well in the terminal, so the problem might lie on the launcher. But I get confused because in the launcher, the command ipython notebook runs well.

fehiepsi avatar Sep 17 '15 09:09 fehiepsi

@fehiepsi What do you get from conda list?

minrk avatar Sep 17 '15 12:09 minrk

Here is my result of conda list

# packages in environment at /home/fehiepsi/miniconda3:
#
certifi                   14.05.14                 py34_0  
conda                     3.17.0                   py34_0  
conda-env                 2.4.2                    py34_0  
decorator                 4.0.2                    py34_0  
fontconfig                2.11.1                        4  
freetype                  2.5.2                         2  
ipykernel                 4.0.3                    py34_0  
ipython                   4.0.0                    py34_0  
ipython-genutils          0.1.0                     <pip>
ipython-notebook          4.0.4                    py34_0  
ipython_genutils          0.1.0                    py34_0  
ipywidgets                4.0.2                    py34_0  
jinja2                    2.8                      py34_0  
jsonschema                2.4.0                    py34_0  
jupyter                   1.0.0                    py34_0  
jupyter-client            4.0.0                     <pip>
jupyter-console           4.0.2                     <pip>
jupyter-core              4.0.4                     <pip>
jupyter_client            4.0.0                    py34_0  
jupyter_console           4.0.2                    py34_0  
jupyter_core              4.0.4                    py34_0  
libgfortran               1.0                           0  
libpng                    1.6.17                        0  
libsodium                 0.4.5                         0  
libxml2                   2.9.2                         0  
markupsafe                0.23                     py34_0  
matplotlib                1.4.3                np19py34_2  
mistune                   0.7.1                    py34_0  
nbconvert                 4.0.0                    py34_0  
nbformat                  4.0.0                    py34_0  
notebook                  4.0.4                    py34_0  
numpy                     1.9.2                    py34_1  
openblas                  0.2.14                        1  
openssl                   1.0.1k                        1  
path.py                   7.6.1                    py34_0  
pexpect                   3.3                      py34_0  
pickleshare               0.5                      py34_0  
pip                       7.1.2                    py34_0  
ptyprocess                0.4                      py34_0  
pycosat                   0.6.1                    py34_0  
pygments                  2.0.2                    py34_0  
pyparsing                 2.0.3                    py34_0  
pyqt                      4.11.3                   py34_1  
python                    3.4.3                         1  
python-dateutil           2.4.2                    py34_0  
pytz                      2015.4                   py34_0  
pyyaml                    3.11                     py34_1  
pyzmq                     14.7.0                   py34_0  
qt                        4.8.6                         3  
qtconsole                 4.0.1                    py34_0  
readline                  6.2                           2  
requests                  2.7.0                    py34_0  
setuptools                18.1                     py34_0  
simplegeneric             0.8.1                    py34_0  
sip                       4.16.5                   py34_0  
six                       1.9.0                    py34_0  
sqlite                    3.8.4.1                       1  
system                    5.8                           2  
terminado                 0.5                      py34_0  
tk                        8.5.18                        0  
tornado                   4.2.1                    py34_0  
traitlets                 4.0.0                    py34_0  
wheel                     0.24.0                   py34_0  
xz                        5.0.5                         0  
yaml                      0.1.6                         0  
zeromq                    4.0.5                         0  
zlib                      1.2.8                         0

The result for which jupyter and which ipython:

fehiepsi@binhyen:~$ which jupyter
/home/fehiepsi/miniconda3/bin/jupyter
fehiepsi@binhyen:~$ which ipython
/home/fehiepsi/miniconda3/bin/ipython

fehiepsi avatar Sep 18 '15 01:09 fehiepsi

By the way, except the command jupyter notebook which gives the above error, the other commands such that jupyter-notebook or ipython notebook run fine. So I think that this is just a small issue and can be fixed.

fehiepsi avatar Sep 19 '15 17:09 fehiepsi

I bumped into this issue during a PR to IJulia. The issue can be reproduced by the following julia code

Pkg.clone("Conda")
Pkg.build("Conda")
using Conda
Conda.add("jupyter")
run(`$(joinpath(Conda.SCRIPTDIR,"jupyter")) notebook`) # errors
run(`$(joinpath(Conda.SCRIPTDIR,"jupyter")) kernelspec --version`) # do also error

dhoegh avatar Sep 21 '15 17:09 dhoegh

Some more info I can only reproduce it on Windows. But I have seen it on travis at this commit https://travis-ci.org/Luthaf/Conda.jl/builds/81279978

dhoegh avatar Sep 21 '15 19:09 dhoegh

@fehiepsi do you still get this if you upgrade jupyter_core to 4.0.6? @dhoegh I think I know what's up on Travis, it's probably that jupyter-kernelspec isn't on PATH, and we should be able to fix that by ensuring that the dir containing jupyter is on PATH when dispatching to subcommands.

minrk avatar Sep 25 '15 09:09 minrk

I ran into this issue using a private miniconda distribution in the Conda package for julia. jupyter or jupyter-kernelspec was not in PATH but jupyter was referenced to with an absolute path to the jupyter executable. See https://github.com/JuliaLang/IJulia.jl/blob/855235f2ec50de2e7c792474ac56780666135747/deps/build.jl#L36.

dhoegh avatar Sep 25 '15 10:09 dhoegh

Yup, that should be fixable pretty easily. I've got a working fix right now, I just need to make sure it doesn't do the wrong thing when python -m is used.

minrk avatar Sep 25 '15 10:09 minrk

@dhoegh I opened jupyter/jupyter_core#62 which should fix that case. It's possible the Windows issue is the same.

minrk avatar Sep 25 '15 12:09 minrk

@minrk I have update jupyter_core to version 4.0.6 but still get the same issue. The command with full path fails in terminal:

fehiepsi@binhyen:~$ /home/fehiepsi/miniconda3/envs/notebook/bin/jupyter notebook
jupyter: 'notebook' is not a Jupyter command

fehiepsi avatar Sep 25 '15 12:09 fehiepsi

@fehiepsi that looks like it's the same PATH issue @dhoegh is seeing and is fixed by jupyter/jupyter_core#62.

minrk avatar Sep 25 '15 14:09 minrk

@minrk - are you okay with closing this?

jasongrout avatar Oct 06 '15 19:10 jasongrout

On windows, using python 2.7, after installing jupyter via pip:

  • the jupyter dir is actually on the PATH
  • 'jupyter-notebook' works as expected
  • 'jupyter notebook' fails with "jupyter: 'notebook' is not a Jupyter command"

stephane-martin avatar Nov 06 '15 16:11 stephane-martin

@stephane-martin pip list?

minrk avatar Nov 06 '15 21:11 minrk

@stephane-martin : me too with the newest version of anaconda; please wait for jupyter 4.1 I think :)

# packages in environment at /home/fehiepsi/miniconda3/envs/notebook:
#
certifi                   2015.9.6.2               py35_0  
decorator                 4.0.4                    py35_0  
fontconfig                2.11.1                        5  
freetype                  2.5.5                         0  
ipykernel                 4.1.1                    py35_0  
ipython                   4.0.0                    py35_0  
ipython-genutils          0.1.0                     <pip>
ipython_genutils          0.1.0                    py35_0  
ipywidgets                4.1.0                    py35_0  
jinja2                    2.8                      py35_0  
jsonschema                2.4.0                    py35_0  
jupyter                   1.0.0                    py35_0  
jupyter-client            4.1.1                     <pip>
jupyter-console           4.0.3                     <pip>
jupyter-core              4.0.6                     <pip>
jupyter_client            4.1.1                    py35_0  
jupyter_console           4.0.3                    py35_0  
jupyter_core              4.0.6                    py35_0  
libgfortran               1.0                           0  
libpng                    1.6.17                        0  
libsodium                 1.0.3                         0  
libxml2                   2.9.2                         0  
llvmlite                  0.8.0                    py35_0  
markupsafe                0.23                     py35_0  
matplotlib                1.4.3               np110py35_2  
mistune                   0.7.1                    py35_0  
nbconvert                 4.0.0                    py35_0  
nbformat                  4.0.1                    py35_0  
notebook                  4.0.6                    py35_0  
numba                     0.22.1              np110py35_0  
numpy                     1.10.1                   py35_0  
openblas                  0.2.14                        3  
openssl                   1.0.2d                        0  
path.py                   8.1.2                    py35_0  
pexpect                   3.3                      py35_0  
pickleshare               0.5                      py35_0  
pip                       7.1.2                    py35_0  
ptyprocess                0.5                      py35_0  
pygments                  2.0.2                    py35_0  
pyparsing                 2.0.3                    py35_0  
pyqt                      4.11.4                   py35_0  
python                    3.5.0                         1  
python-dateutil           2.4.2                    py35_0  
pytz                      2015.7                   py35_0  
pyzmq                     14.7.0                   py35_1  
qt                        4.8.7                         0  
qtconsole                 4.1.0                    py35_0  
readline                  6.2                           2  
setuptools                18.4                     py35_0  
simplegeneric             0.8.1                    py35_0  
sip                       4.16.9                   py35_0  
six                       1.10.0                   py35_0  
sqlite                    3.8.4.1                       1  
terminado                 0.5                      py35_1  
tk                        8.5.18                        0  
tornado                   4.2.1                    py35_1  
traitlets                 4.0.0                    py35_0  
wheel                     0.26.0                   py35_1  
xz                        5.0.5                         0  
zeromq                    4.1.3                         0  
zlib                      1.2.8                         0

fehiepsi avatar Nov 07 '15 06:11 fehiepsi

I got the same issue. Python 2.7, Mac OSX, python27, iPython, jupyter, jupiter_core all installed from pip. iPython notebook command is fine. Python is installed from home-brew.

I don't know why jupyter wants to dictate iPython so aggressively, since iPython notebook keeps giving me feedback saying "this command is going to be dropped " but the issue still existed and doesn't match what jupyter documentation.

Hualin avatar Feb 04 '16 21:02 Hualin

Does jupyter-notebook (with a hyphen instead of a space) work?

takluyver avatar Feb 04 '16 22:02 takluyver

@Hualin where do you find jupyter-notebook? What do you get from pip list?

If you are using Python from Python.org, make sure that you have /Library/Frameworks/Python.framework/Versions/2.7/bin on your PATH, since that's where pip will put executables if you are using that Python distribution.

minrk avatar Feb 05 '16 10:02 minrk

@minrk python27 is installed from home-brew, all other python package if possible are all installed from pip. iPython Notebook and all other cmds work fine, without any problem. Jupyter is installed from pip and I followed the docs exactly, not sure any thing I should do apart from follow the docs otherwise the docs is invalid in the first place.

I am sure pip list get all the jupyter package I should have to fire jupyter notebook. jupyter-core and jupyter-notebook is indeed in the path you mentioned but not in the main path where I fire up all the cmd, which is in usr/local/bin, the routine I follow from Home-brew.

the problem is fixed by adding symbolic link from python frame path to usr/local/bin, which I am afraid I might have to do it every time I upgrade jupyter.

many thanks for your reply.

Hualin avatar Feb 05 '16 17:02 Hualin

while the problem is why jupyter is in usr/local/bin but not jupiter-notebook? very strange. it is however kind of confusing for me from the beginning of Jupyter, that I am not sure how many package I should install with prefix of Jupyter, like Jupyter-kernel, jupyter-XXX about 5 -10 packages in PyPI and the docs in early stage is very much brief.

I think it is very personal feeling for me, that I am not a fan of Jupyter, from its early confusion, every time iPython pop up the message of saying the notebook is going to be dropped, and this tiny struggle. The project is very ambitious and progress very fast and sometimes aggressively which is the reason why I don't like it. not everybody appreciates to understand the glorious future vision of Jupyter and why not just keep iPython notebook unaffected?

Hualin avatar Feb 05 '16 17:02 Hualin