Jupyter notebook don't start (ubuntu)

I can’t launch jupyter notebook.

  1. pip3 install --upgrade pip

  1. pip3 install notebook

  1. and command “jupyter notebook” return “Jupyter command jupyter-notebook not found”
    usage: jupyter [-h] [–version] [–config-dir] [–data-dir] [–runtime-dir] [–paths] [–json] [–debug] [subcommand]

Jupyter: Interactive Computing

positional arguments:
subcommand the subcommand to launch

optional arguments:
-h, --help show this help message and exit
–version show the versions of core jupyter packages and exit
–config-dir show Jupyter config dir
–data-dir show Jupyter data dir
–runtime-dir show Jupyter runtime dir
–paths show all Jupyter paths. Add --json for machine-readable format.
–json output paths as machine-readable json
–debug output debug information about paths

Available subcommands: migrate troubleshoot

Jupyter command jupyter-notebook not found.

  1. comand “jupyter” return
    usage: jupyter [-h] [–version] [–config-dir] [–data-dir] [–runtime-dir] [–paths] [–json] [–debug] [subcommand]

Jupyter: Interactive Computing

positional arguments:
subcommand the subcommand to launch

optional arguments:
-h, --help show this help message and exit
–version show the versions of core jupyter packages and exit
–config-dir show Jupyter config dir
–data-dir show Jupyter data dir
–runtime-dir show Jupyter runtime dir
–paths show all Jupyter paths. Add --json for machine-readable format.
–json output paths as machine-readable json
–debug output debug information about paths

Available subcommands: migrate troubleshoot

Please specify a subcommand or one of the optional arguments.

  1. jupyter --version
    usage: jupyter [-h] [–version] [–config-dir] [–data-dir] [–runtime-dir] [–paths] [–json] [–debug] [subcommand]

Jupyter: Interactive Computing

positional arguments:
subcommand the subcommand to launch

optional arguments:
-h, --help show this help message and exit
–version show the versions of core jupyter packages and exit
–config-dir show Jupyter config dir
–data-dir show Jupyter data dir
–runtime-dir show Jupyter runtime dir
–paths show all Jupyter paths. Add --json for machine-readable format.
–json output paths as machine-readable json
–debug output debug information about paths

Available subcommands: migrate troubleshoot

Jupyter command jupyter-notebook not found.

(python 3.9.7, Ubuntu 21.10)

shortcut for jupyter is missing on my desktop.
How I can fix it?

This post says for using pip3 to use the following to run the notebooks:

python3 -m notebook

You clearly have jupyter something installed.
Maybe try some of the other suggestions on that page I reference if that particular one doesn’t help? Then dig in to what you see from the following if you need more help:

jupyter –paths

If all that fails, or if you’d rather do it maybe a better way that would allow more reproducibility for your efforts in the long run, I’d suggest installing conda (or mamba) and learn to run things in conda envs.

Right, a few other things that might shed some light:

which notebook
which jupyter
which jupyter-notebook

Basically, as a Jupyter user, you really don’t want to mess up your system’s python3 (which is uses for all sorts of things). If you can deal with the packages provided by your distro, then everything’s great, but as soon as you start mixing in sudo pip3 things can get hairy, and irrecoverable.

I can personally vouch for conda (or especially mamba), but if you really want to stay with pip, your default python almost certainly ships with venv… with this, you can at least reuse your base python install, but manage the rest of your pip stuff in a dedicated folder.

1 Like