Issue
In Debian 11 I had installed jupyter lab with pip in my user directory, but on Debian 12 this is not possible anymore since href="https://www.debian.org/releases/stable/i386/release-notes/ch-information.en.html#python3-pep-668" rel="nofollow noreferrer">Debian decided to follow pep-668 and python packages are marked as externally managed, you can only install system wide with the package manager (APT).
I installed python3-jupyterlab-server lab with APT, but it fails to start
$ sudo apt reinstall python3-jupyterlab-server ... ... Preparing to unpack .../python3-jupyterlab-server_2.16.5-1_all.deb ... Unpacking python3-jupyterlab-server (2.16.5-1) over (2.16.5-1) ... Setting up python3-jupyterlab-server (2.16.5-1) ... $ jupyter lab Traceback (most recent call last): File "/usr/local/bin/jupyter-lab", line 5, in <module> from jupyterlab.labapp import main ModuleNotFoundError: No module named 'jupyterlab'
I installed Jupyter Lab with pip in a virtual environment and can successfully start it from there. Is this the only way?
I understand the value of virtual environments or conda for maintaining a lot of data analysis packages. But Jupyter Lab is now a core component of the system, so I guess it should be installed system-wide with the system package manage (APT on Debian). I'm wondering what's wrong in my config, why can't I start jupyter lab when installed from apt?
Related questions:
- How do I solve "error: externally-managed-environment" every time I use pip 3?
- pip install -r requirements.txt is failing: "This environment is externally managed"
Solution
Have you tried installing pipx
via apt
and then installing it via pipx install jupyterlab
?
It is an alternative way of installing packages mentioned in the first link.
Answered By - pathetic-lynx Answer Checked By - Dawn Plyler (WPSolving Volunteer)