'Jupyter command `jupyter-lab` not found

I have tried to install jupyter lab on my Kubuntu machine. If I install jupyter lab with 'pip3 install jupyter jupyterlab' the command 'jupyter notebook' works completly fine. But if I try to run 'jupyter lab' every time I get the message:

Traceback (most recent call last):
  File "/usr/local/bin/jupyter", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/jupyter_core/command.py", line 230, in main
    command = _jupyter_abspath(subcommand)
  File "/usr/local/lib/python3.6/dist-packages/jupyter_core/command.py", line 133, in _jupyter_abspath
    'Jupyter command `{}` not found.'.format(jupyter_subcommand)
Exception: Jupyter command `jupyter-lab` not found.

What is wrong?

I tried to reinstall jupyter and jupyterlab multiple times with the same issue.



Solution 1:[1]

Its the space. Its always the space. Never ever use spaces within package name. Its always either namepart1-namepart2 or namepart1namepart2. This is because arguments are separated by space. So if you put space in between, it makes pip think that you want to install two different packages named jupyter and lab. Just use:

python -m pip install jupyterlab

Or simply:

pip install jupyterlab

No need to uninstall or reinstall anything. However to run jupyter lab server you might want to add spaces as follows:

jupyter lab

Solution 2:[2]

In my case, the only way to fix this was to add the following directory to the PATH in Linux:

/home/ubuntu/.local/bin

Solution 3:[3]

I had the same error on Windows 10. It was with pip install jupyterlab. Then after the error I uninstalled it with pip and reinstalled with "pip install jupyterlab". Everything worked flawlessly thereafter.

In your case you're using pip3. Try it as above or see if pip3 needs an update.

Solution 4:[4]

When installing jupyterlab, we may get warning like this:

Installing collected packages: jupyterlab
  WARNING: The scripts jlpm, jupyter-lab, jupyter-labextension and jupyter-labhub are installed in '/home/tln/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed jupyterlab-3.0.14

So as per this warning, scripts like jupyter-lab will be unavailable unless added to the PATH.

Use below command to add these scripts to be able to use from command line:

tln@tln-X550LD:~$ export PATH="$HOME/.local/bin:$PATH"

That's it. This worked fine for me.

Solution 5:[5]

I had same issue. I solved it running pip install jupyterlab in prompt with admin privilegies.

Solution 6:[6]

Had the same issue and resolved it by installing with pip3

pip3 install jupyterlab; jupyter lab

Solution 7:[7]

If you face -bash: jupyter-lab: command not found or -bash: jupyter: command not found, etc., you can look for "jupyter-lab" and enter that full path instead.

Mac:

$ /Users/mark/venv/bin/jupyter-lab

Windows:

C:\mark\venv\Scripts\jupyter-lab.exe

Solution 8:[8]

I got this same error every time I forgot to activate the virtualenv jupyterlab was installed into. After activating the virtualenv, all's well.

With pip

$ source [path_to_venv]/bin/activate

With pipenv

$ pipenv shell

Then, with a prompt indicating an activated shell, you can enter your command

(venv) $ jupyter lab

With conda or other more holistic python environments, you probably use their gui to activate a virtualenv with jupyter and jupyterlab installed.

Solution 9:[9]

well the problem is like this:

the jupyterlab module has not been packaged for debian, but the jupyterlab_server package has, named python3-jupyterlab-server. please sudo apt install python3-jupyterlab-server.

then, as your user, run pip3 install jupyterlab, that will install it in your ~/.local/bin a few programs, the missing jupyter-lab among them.

last, but not least, run jupyter-serverextension enable --py jupyterlab.

to be able to run jupyter lab, you first need to run export PATH="/home/$(whoami)/.local/bin:"$PATH. this command will run automatically if added to your ~/.bash_profile.

Solution 10:[10]

Install with Anaconda

conda install -c conda-forge notebook
conda install -c conda-forge jupyter
conda install -c conda-forge jupyter_contrib_nbextensions