CacherJoe100
CacherJoe100

Reputation: 661

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.

Upvotes: 66

Views: 146203

Answers (17)

TheTubaGeek
TheTubaGeek

Reputation: 1

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.

Upvotes: 0

Samuel Tosan Ayo
Samuel Tosan Ayo

Reputation: 379

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

Upvotes: 0

Mister Verleg
Mister Verleg

Reputation: 4303

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

Upvotes: -2

Ryan
Ryan

Reputation: 416

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

Upvotes: 0

Nelson Javier Avila
Nelson Javier Avila

Reputation: 602

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

Upvotes: 3

isco Adams
isco Adams

Reputation: 1

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

Upvotes: 0

Ali Esmaily
Ali Esmaily

Reputation: 1141

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

Upvotes: 0

peterretief
peterretief

Reputation: 2067

Install with Anaconda

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

Upvotes: 2

alex
alex

Reputation: 955

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.

Upvotes: 0

Sammi
Sammi

Reputation: 41

Had the same issue and resolved it by installing with pip3

pip3 install jupyterlab; jupyter lab

Upvotes: 4

renato souza
renato souza

Reputation: 49

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

Upvotes: 4

TheLittleNaruto
TheLittleNaruto

Reputation: 8473

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.

Upvotes: 26

nferreira78
nferreira78

Reputation: 1174

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

/home/ubuntu/.local/bin

Upvotes: 21

mightypile
mightypile

Reputation: 8022

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.

Upvotes: 1

Reveille
Reveille

Reputation: 4629

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

Upvotes: 1

Axel
Axel

Reputation: 126

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.

Upvotes: 10

Hamza
Hamza

Reputation: 6055

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

Upvotes: 80

Related Questions