Jupyter command `jupyter-lab` not found
Asked Answered
C

17

59

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.

Cohlier answered 27/8, 2019 at 14:58 Comment(3)
why it says 'jupyter-lab', it should give error as Error executing Jupyter command 'lab': [Errno 2] No such file or directory. Check your command again. it should be just jupyter lab, nothing else in between except a space.Misprint
I just execute the command 'jupyter lab' without '-'.Cohlier
try installing it using "conda"Allemande
A
79

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
Astarte answered 20/11, 2019 at 16:57 Comment(3)
As usual on stackoverflow, any answer more than a year old will become obsolete so this is now incorrect except for older OSes. jupyter removed jupyter lab from its default install, so you must separately do pip install jupyterlab.Confound
Dont understand whats obselete here? Works on Windows 11, Python 3.9Astarte
One important point here is to look at the output of pip install jupyterlab. Did it have any errors? I had. Perhaps some files were being used when tried to install. Login. Logout. Pip install jupyterlab again. And volà!Ruffina
C
23

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.

Chee answered 16/4, 2021 at 18:58 Comment(0)
K
21

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

/home/ubuntu/.local/bin
Kneedeep answered 17/7, 2020 at 10:43 Comment(0)
A
10

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.

Aruabea answered 28/10, 2019 at 16:55 Comment(1)
the jupyter lab package doesn't exist as it should be in one word (jupyterlab)Thew
K
4

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

Khasi answered 22/10, 2021 at 23:24 Comment(0)
K
4

Had the same issue and resolved it by installing with pip3

pip3 install jupyterlab; jupyter lab

Kelleekelleher answered 30/12, 2021 at 17:59 Comment(0)
L
3

Once installed you just have to run

pip install jupyterlab

~/.local/bin/jupyter-lab

and ready and open browser http://localhost:8888/lab

Ubuntu 22 Lubuntu 22

Lezlie answered 14/7, 2022 at 20:40 Comment(0)
A
2

Install with Anaconda

conda install -c conda-forge notebook
conda install -c conda-forge jupyter
conda install -c conda-forge jupyter_contrib_nbextensions
Apostil answered 11/2, 2022 at 8:38 Comment(0)
L
1

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
Lorettalorette answered 16/3, 2020 at 14:34 Comment(2)
I have a W10 system. For some weird reason (I'm not interested in figuring out why) I've got the jupyter-lab.exe installed in a different folder. In case you don't find that executable file, look for it using the Windows File Explorer.Toulouselautrec
I came back here just to tell you the best and quicker way to find the exe file. Open the command prompt and go to the C:/ drive. Type in dir jupyter-lab.exe /s /p This should give you the exact location of the file.Toulouselautrec
P
1

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.

Periosteum answered 30/6, 2020 at 0:56 Comment(0)
A
0

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.

Allred answered 21/1, 2022 at 16:13 Comment(0)
R
0

ubuntu can not find the jupyter-lab because it is not in path.

in order to check the place of installment. run below command

find ~ -name jupyter-lab

possible result: /home/soshiant/.local/bin/jupyter-lab

for adding a directory to the Linux path you can follow below link:

How to add a directory to the PATH

Rollandrollaway answered 13/6, 2022 at 6:46 Comment(0)
R
0

if anyone still struggling ... try:

find ~ -name jupyter-lab

and then:

export PATH=[path] 

then try again: jupyter lab note: don't add any extra spaces and PATH is case sensitive and if u still struggling just try to install any missing pkgs after hosting to the main path by opining another tab or changing the path to main. and then host to localhost:8888/lab that should works fine...

Roshelle answered 22/6, 2022 at 1:19 Comment(0)
V
0

I was using conda to install conda install -c conda-forge jupyterlab and this error came about.

I simply used this command to get it to run. pip install jupyterlab

Vow answered 26/12, 2022 at 3:3 Comment(1)
In the short term this may fix things, but mixing and matching package managers is going to compound your issues in the related environments in the long run.Larva
E
0

Do this by running export PATH=$PATH:~/.local/bin for your current session

Elenore answered 29/6 at 1:43 Comment(0)
T
0

If you are running the latest version of Python (currently 3.14), JupyterLab will not install. It will go through the process then come back with an error:

      × Building wheel for rpds-py (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [47 lines of output]
      Running `maturin pep517 build-wheel -i /home/russell/.pyenv/versions/3.14-dev/bin/python3.14 --compatibility off`
      📦 Including license file "/tmp/pip-install-pf8a6hvj/rpds-py_01177995b9ba4155bfe482750557cbef/LICENSE"
      🔗 Found pyo3 bindings
      🐍 Found CPython 3.14 at /home/russell/.pyenv/versions/3.14-dev/bin/python3.14
      📡 Using build options features from pyproject.toml
         Compiling target-lexicon v0.12.14
         Compiling once_cell v1.19.0
         Compiling proc-macro2 v1.0.86
         Compiling unicode-ident v1.0.12
         Compiling libc v0.2.155
         Compiling autocfg v1.3.0
         Compiling heck v0.5.0
         Compiling triomphe v0.1.13
         Compiling static_assertions v1.1.0
         Compiling indoc v2.0.5
         Compiling cfg-if v1.0.0
         Compiling archery v1.2.0
         Compiling unindent v0.2.3
         Compiling rpds v1.1.0
         Compiling memoffset v0.9.1
         Compiling quote v1.0.36
         Compiling pyo3-build-config v0.22.1
         Compiling syn v2.0.69
         Compiling pyo3-macros-backend v0.22.1
         Compiling pyo3-ffi v0.22.1
         Compiling pyo3 v0.22.1
      error: failed to run custom build command for `pyo3-ffi v0.22.1`
      
      Caused by:
        process didn't exit successfully: `/tmp/pip-install-pf8a6hvj/rpds-py_01177995b9ba4155bfe482750557cbef/target/release/build/pyo3-ffi-c89841ba693cb62c/build-script-build` (exit status: 1)
        --- stdout
        cargo:rerun-if-env-changed=PYO3_CROSS
        cargo:rerun-if-env-changed=PYO3_CROSS_LIB_DIR
        cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_VERSION
        cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_IMPLEMENTATION
        cargo:rerun-if-env-changed=PYO3_PRINT_CONFIG
        cargo:rerun-if-env-changed=PYO3_USE_ABI3_FORWARD_COMPATIBILITY
      
        --- stderr
        error: the configured Python interpreter version (3.14) is newer than PyO3's maximum supported version (3.13)
        = help: please check if an updated version of PyO3 is available. Current version: 0.22.1
        = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI
      warning: build failed, waiting for other jobs to finish...
      💥 maturin failed
        Caused by: Failed to build a native library through cargo
        Caused by: Cargo build finished with "exit status: 101": `env -u CARGO PYO3_ENVIRONMENT_SIGNATURE="cpython-3.14-64bit" PYO3_PYTHON="/home/russell/.pyenv/versions/3.14-dev/bin/python3.14" PYTHON_SYS_EXECUTABLE="/home/russell/.pyenv/versions/3.14-dev/bin/python3.14" "cargo" "rustc" "--features" "pyo3/extension-module" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/pip-install-pf8a6hvj/rpds-py_01177995b9ba4155bfe482750557cbef/Cargo.toml" "--release" "--lib"`
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/home/russell/.pyenv/versions/3.14-dev/bin/python3.14', '--compatibility', 'off'] returned non-zero exit status 1

The only solution I found was to install Python 3.13 then install JupyterLab from there.

Turtledove answered 12/7 at 18:11 Comment(0)
B
-2

In my ubuntu installation this was qused by not using sudo before the install.

sudo pip install jupyterlab

If you already installed jupyterlab, and it dit not work, you can install again using sudo, you dont need to remove the old version first for it to work

Betz answered 13/1, 2023 at 7:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.