Error: externally-manage when installing jupyterlab

When I try to install jupyterlab using this command

python3.11 -m pip install jupyterlab

error: externally-managed-environment
This environment is externally managed

I tried to verify this

python3.11 -m pip --version
pip 23.0.1 from /usr/lib/python3/dist-packages/pip (python 3.11)

and it outputs no errors.

Of course the whole process started from

Maybe some of you have the light to solve this error of me ?
Thank you so much

it was decided that installing pip packages in a managed environment (like from your operating systems package manager, for example apt, dnf, pacman…) people shall use virtual environments or risk breaking stuff.

you have several options here.

  1. use a virtual environment by running py -m venv yourvenvfoldername and then activating it by source yourvenvfoldername/bin/activate. you can now install pip packages into this virtual environment. when you want to start jupyterlab you will always have to activate.

  2. install without a venv by using --break-system-packages flag in the pip command.

  3. basically option two but less annoying, create ~/.config/pip/pip.conf file and insert

break-system-packages = true

for a simple local jupyterlab installation, i’d recommend option 1.

1 Like