Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'notebook' is not a Jupyter command #448

Closed
fehiepsi opened this issue Sep 17, 2015 · 40 comments · Fixed by jupyter/jupyter_core#62
Closed

'notebook' is not a Jupyter command #448

fehiepsi opened this issue Sep 17, 2015 · 40 comments · Fixed by jupyter/jupyter_core#62

Comments

@fehiepsi
Copy link

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.

@minrk
Copy link
Member

minrk commented Sep 17, 2015

@fehiepsi What do you get from conda list?

@fehiepsi
Copy link
Author

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
Copy link
Author

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.

dhoegh added a commit to dhoegh/IJulia.jl that referenced this issue Sep 21, 2015
dhoegh added a commit to dhoegh/IJulia.jl that referenced this issue Sep 21, 2015
dhoegh added a commit to dhoegh/IJulia.jl that referenced this issue Sep 21, 2015
@dhoegh
Copy link

dhoegh commented Sep 21, 2015

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
Copy link

dhoegh commented Sep 21, 2015

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 added a commit to dhoegh/IJulia.jl that referenced this issue Sep 22, 2015
dhoegh added a commit to dhoegh/IJulia.jl that referenced this issue Sep 22, 2015
dhoegh added a commit to dhoegh/IJulia.jl that referenced this issue Sep 22, 2015
dhoegh added a commit to dhoegh/IJulia.jl that referenced this issue Sep 22, 2015
@minrk
Copy link
Member

minrk commented Sep 25, 2015

@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.

@dhoegh
Copy link

dhoegh commented Sep 25, 2015

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.

@minrk
Copy link
Member

minrk commented Sep 25, 2015

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
Copy link
Member

minrk commented Sep 25, 2015

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

@fehiepsi
Copy link
Author

@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

@minrk
Copy link
Member

minrk commented Sep 25, 2015

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

dhoegh added a commit to dhoegh/IJulia.jl that referenced this issue Sep 27, 2015
dhoegh added a commit to dhoegh/IJulia.jl that referenced this issue Sep 27, 2015
@ellisonbg ellisonbg added this to the 4.1 milestone Oct 6, 2015
@jasongrout
Copy link
Member

@minrk - are you okay with closing this?

@minrk minrk closed this as completed Oct 6, 2015
@Hualin
Copy link

Hualin commented Feb 5, 2016

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?

@takluyver
Copy link
Member

I'm equally puzzled why your jupyter command is installed in a different place from jupyter-notebook. As far as I know, they're both specified in the same way and installed by pip, so they should both end up in the same place.

You probably don't need to worry about the different jupyter- packages: installing the top level jupyter package should automatically get all the bits you need.

@minrk
Copy link
Member

minrk commented Feb 6, 2016

why not just keep iPython notebook unaffected?

If you want to keep IPython notebook unaffected, you can pin IPython to the last version with the notebook:

pip install "ipython<4"

I'm sorry the transition is not going well for you. It is extremely strange that the jupyter-notebook executable isn't in the same directory as the jupyter executable. The location of these files is up to pip, not the packages. Do you find a jupyter-notebook executable anywhere? Perhaps in ~/Library/Python/2.7/bin or ~/.local?

I would expect reinstalling the notebook to fix this:

pip uninstall notebook
pip install --upgrade notebook

But I'm not sure how the file went missing in the first place.

@damienstanton
Copy link

I am also having some odd issues as of a recent Jupyter install using pip3 on OS X 10.11. jupyter is not found anywhere in my path, although it is listed in the python 3.5 site-packages dir.

jupyter-notebook seems to work fine on its own. As an aside, I cannot use it as an Apache PySpark driver. If I try to set PYSPARK_DRIVER_PYTHON=jupyter-notebook, I get an error :

[C 10:08:57.048 NotebookApp] No such file or directory: /Users/damien/work_folder/notebook

while the old setting PYSPARK_DRIVER_PYTHON=ipython with PYSPARK_DRIVER_PYTHON_OPTS='notebook' works perfectly.

@takluyver
Copy link
Member

@damienstanton the jupyter command is provided by the package jupyter_core. Can you try uninstalling and reinstalling that to see if it fixes things?

@willingc
Copy link
Member

willingc commented Feb 9, 2016

@takluyver Just to clarify, the uninstall/reinstall commands would be:

pip3 uninstall jupyter
pip3 install jupyter

@takluyver
Copy link
Member

I was suggesting uninstalling and installing jupyter_core, not jupyter.

The jupyter_core package provides the jupyter command. All of the other Jupyter packages depend on this.

The jupyter package contains no code, but it depends on all of the jupyter pieces, so it's a quick way for people to install everything. However, I don't think uninstalling it with pip will affect anything else, so it probably won't fix a broken installation.

@willingc
Copy link
Member

willingc commented Feb 9, 2016

@takluyver Thanks. Quick question: if one does pip3 uninstall jupyter, doesn't it uninstall everything, including jupyter_core?

Then, pip3 install --force-reinstall jupyter would reinstall all including jupyter_core. Correct or not?

@takluyver
Copy link
Member

I don't think pip uninstalls dependencies, so if you uninstall jupyter, I don't think that will remove anything else. I could be wrong, though.

--force-reinstall may be enough to reinstall everything, so long as that works on dependencies as well.

@yegortk
Copy link

yegortk commented Feb 26, 2016

I also had the issue on osx with homebrew python installation, where pip install jupyter would not put jupyter-notebook in /usr/local/bin , while correctly installing other components.

The following, as recommended above, resolved the issue:
pip uninstall notebook
pip install --upgrade notebook

@damienstanton
Copy link

I got mine working by deleting the Library/Caches/pip/... entries for Jupyter, then running pip3 uninstall jupyter followed by pip3 install --upgrade jupyter.

I believe the issue had something to do with a mismatched jupyter_core in my pip cache.

@mgrani
Copy link

mgrani commented Feb 28, 2016

I had the same problem on a Mac OSX el capitan using python3.5 installed from python.org. Reinstalling did not work.
My solution, which is not perfect, was to extend PATH to /Library/Frameworks/Python.framework/Versions/3.5/bin/. It seems that jupyter notebook requires the jupyter-notebook binary to be on the executables path.

@juliohm
Copy link

juliohm commented Mar 18, 2016

I am having the same issue on a fresh install on Arch Linux. I installed jupyter 4.1.0 from the repositories and the 'notebook' subcommand is not recognized.

@takluyver
Copy link
Member

@juliohm can you do which jupyter and see if there is a jupyter-notebook in the same location?

@juliohm
Copy link

juliohm commented Mar 18, 2016

@takluyver there is no jupyter-notebook in the same location.

@takluyver
Copy link
Member

I don't know how Arch installation works, but using pip or conda, there are three packages involved:

  • jupyter is a ~empty package which depends on all the real Jupyter packages
  • notebook contains the jupyter-notebook script which launches the notebook application.
  • jupyter_core contains the jupyter script, which turns the subcommand jupyter notebook into a call to jupyter-notebook.

Is it possible that you have only got the last of those installed instead of all three?

@juliohm
Copy link

juliohm commented Mar 19, 2016

@takluyver you were right, I needed to install another package jupyter-notebook. Everything is working now. Thank you.

@jordanst3wart
Copy link

@mgrani I have a similar setup, but I moved jupyter-notebook to the /usr/local/bin directory.

xhudik added a commit to xhudik/notebooks that referenced this issue Jul 10, 2016
sometimes jupyter notebook won't run (e.g. jupyter/notebook#448). If it is the case ipython3 notebook will come handy
ckalima pushed a commit to planet-os/notebooks that referenced this issue Jul 22, 2016
sometimes jupyter notebook won't run (e.g. jupyter/notebook#448). If it is the case ipython3 notebook will come handy
@coldray
Copy link

coldray commented Sep 24, 2016

Can anyone help me debug this? I got the same error jupyter: 'notebook' is not a Jupyter command
which jupyter I got /usr/local/bin/jupyter
which jupyter-notebook I got jupyter-notebook not found
I did pip3 uninstall notebook and pip3 install --upgrade notebook.
The last line after I did pip3 install --upgrade notebook is Successfully installed notebook-4.2.3, but I still got the error.
Thanks

@jordanst3wart
Copy link

@coldray i'm guesting you have a mac? try moving the file jupyter-notebook to /usr/local/bin/. So that there is the jupyter and the jupyter-notebook files in that directory. I think the jupyter file needs the jupyter-notebook file to run the command jupyter notebook. I think the pip3 command may have installed the jupyter-notebook in the wrong place. I use the command pip3 as well.

Or if that doesn't fix the problem try adding something like: /Library/Frameworks/Python.framework/Versions/3.2/bin to your PATH. Note that 3.2 is the python version I have.

@kstohr
Copy link

kstohr commented Mar 7, 2017

Had this issue on a Mac running Python 3 in a virtual env. Reinstalling notebook as recommended above resolved the issue.
$ pip uninstall notebook
$ pip install --upgrade notebook

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.