I installed the following: jlpoole@ryzdesk ~ $ eix -I jupyter [I] dev-python/hatch-jupyter-builder Available versions: 0.9.1^t {test PYTHON_TARGETS="pypy3 python3_10 python3_11 python3_12 python3_13"} Installed versions: 0.9.1^t(10:19:39 AM 09/23/2024)(-test PYTHON_TARGETS="python3_12 -pypy3 -python3_10 -python3_11 -python3_13") Homepage: https://pypi.org/project/hatch-jupyter-builder/ https://github.com/jupyterlab/hatch-jupyter-builder Description: A hatch plugin to help build Jupyter packages [I] dev-python/jupyter-client Available versions: 8.6.2^t {test PYTHON_TARGETS="pypy3 python3_10 python3_11 python3_12 python3_13"} Installed versions: 8.6.2^t(10:34:41 AM 09/23/2024)(-test PYTHON_TARGETS="python3_12 -pypy3 -python3_10 -python3_11 -python3_13") Homepage: https://jupyter.org/ https://github.com/jupyter/jupyter_client/ https://pypi.org/project/jupyter-client/ Description: Jupyter protocol implementation and client libraries [I] dev-python/jupyter-core Available versions: 5.7.2^t {doc test PYTHON_TARGETS="pypy3 python3_10 python3_11 python3_12 python3_13"} Installed versions: 5.7.2^t(10:27:13 AM 09/23/2024)(-doc -test PYTHON_TARGETS="python3_12 -pypy3 -python3_10 -python3_11 -python3_13") Homepage: https://jupyter.org/ https://github.com/jupyter/jupyter_core/ https://pypi.org/project/jupyter-core/ Description: Core common functionality of Jupyter projects [I] dev-python/jupyter-events Available versions: 0.10.0^t {test PYTHON_TARGETS="pypy3 python3_10 python3_11 python3_12 python3_13"} Installed versions: 0.10.0^t(10:35:10 AM 09/23/2024)(-test PYTHON_TARGETS="python3_12 -pypy3 -python3_10-python3_11 -python3_13") Homepage: https://jupyter.org/ https://github.com/jupyter/jupyter_events/ https://pypi.org/project/jupyter-events/ Description: Jupyter Event System library [I] dev-python/jupyter-lsp Available versions: 2.2.5^t {test PYTHON_TARGETS="pypy3 python3_10 python3_11 python3_12"} Installed versions: 2.2.5^t(11:54:21 AM 09/23/2024)(-test PYTHON_TARGETS="python3_12 -pypy3 -python3_10 -python3_11") Homepage: https://github.com/jupyter-lsp/jupyterlab-lsp https://pypi.org/project/jupyter-lsp/ Description: Multi-Language Server WebSocket proxy for Jupyter Notebook/Lab [I] dev-python/jupyter-packaging Available versions: 0.12.3^t {test PYTHON_TARGETS="pypy3 python3_10 python3_11 python3_12 python3_13"} Installed versions: 0.12.3^t(12:02:25 PM 09/23/2024)(-test PYTHON_TARGETS="python3_12 -pypy3 -python3_10-python3_11 -python3_13") Homepage: https://jupyter.org/ https://github.com/jupyter/jupyter-packaging/ https://pypi.org/project/jupyter-packaging/ Description: Tools to help build and install Jupyter Python packages [I] dev-python/jupyter-server Available versions: 2.14.2^t {test PYTHON_TARGETS="pypy3 python3_10 python3_11 python3_12 python3_13"} Installed versions: 2.14.2^t(10:36:11 AM 09/23/2024)(-test PYTHON_TARGETS="python3_12 -pypy3 -python3_10-python3_11 -python3_13") Homepage: https://jupyter.org/ https://github.com/jupyter-server/jupyter_server/ https://pypi.org/project/jupyter-server/ Description: Core services, APIs, and REST endpoints to Jupyter web applications [I] dev-python/jupyter-server-terminals Available versions: 0.5.3^t {test PYTHON_TARGETS="pypy3 python3_10 python3_11 python3_12 python3_13"} Installed versions: 0.5.3^t(10:35:25 AM 09/23/2024)(-test PYTHON_TARGETS="python3_12 -pypy3 -python3_10 -python3_11 -python3_13") Homepage: https://jupyter.org/ https://github.com/jupyter-server/jupyter_server_terminals/ https://pypi.org/project/jupyter-server-terminals/ Description: A Jupyter Server Extension Providing Terminals [I] dev-python/jupyterlab Available versions: 4.2.4^t ~4.2.5^t {test PYTHON_TARGETS="pypy3 python3_10 python3_11 python3_12"} Installed versions: 4.2.4^t(11:56:24 AM 09/23/2024)(-test PYTHON_TARGETS="python3_12 -pypy3 -python3_10 -python3_11") Homepage: https://jupyter.org/ https://github.com/jupyterlab/jupyterlab/ https://pypi.org/project/jupyterlab/ Description: JupyterLab computational environment [I] dev-python/jupyterlab-pygments Available versions: 0.3.0 {PYTHON_TARGETS="pypy3 python3_10 python3_11 python3_12 python3_13"} Installed versions: 0.3.0(10:22:59 AM 09/23/2024)(PYTHON_TARGETS="python3_12 -pypy3 -python3_10 -python3_11 -python3_13") Homepage: https://pypi.org/project/jupyterlab-pygments/ https://github.com/jupyterlab/jupyterlab_pygments/ Description: Pygments theme making use of JupyterLab CSS variables [I] dev-python/jupyterlab-server Available versions: 2.27.3^t {test PYTHON_TARGETS="pypy3 python3_10 python3_11 python3_12 python3_13"} Installed versions: 2.27.3^t(10:36:26 AM 09/23/2024)(-test PYTHON_TARGETS="python3_12 -pypy3 -python3_10-python3_11 -python3_13") Homepage: https://jupyter.org/ https://github.com/jupyterlab/jupyterlab_server/ https://pypi.org/project/jupyterlab-server/ Description: Server components for JupyterLab and JupyterLab like applications [I] dev-python/jupyterlab-widgets Available versions: 3.0.11 ~3.0.13 {PYTHON_TARGETS="pypy3 python3_10 python3_11 python3_12 python3_13"} Installed versions: 3.0.11(12:03:29 PM 09/23/2024)(PYTHON_TARGETS="python3_12 -pypy3 -python3_10 -python3_11 -python3_13") Homepage: https://ipython.org/ https://pypi.org/project/jupyterlab-widgets/ Description: Jupyter interactive widgets for JupyterLab Found 12 matches jlpoole@ryzdesk ~ $ I also installed dev-python/pipenv as recommended for instances where a user will be installing packages via pip and not want to pollute the Gentoo main Python. See https://wiki.archlinux.org/title/Python/Virtual_environment I created a virtual Python environment "map" and entered is and launched jupyter lab. Reproducible: Always Steps to Reproduce: 1. source map/bin/activate ["map" is the name of the virtual python environment I created with dev-python/pipenv] 2. in the virtual environment's shell: jupyter lab 3. Within Jupyter Lab, try to install the extension "jupyterlab-sql-explorer A JupyterLab extension for Database" by clicking "Install" button Actual Results: In the Jupyter Notebook in the left column re: Extensions, after clicking "Inatll" for the *jupyterlab-sql-explorer* Error when performing an action. Reason given: Error: error: externally-managed-environment × This environment is externally managed ??> The system-wide Python installation in Gentoo should be maintained using the system package manager (e.g. emerge). If the package in question is not packaged for Gentoo, please consider installing it inside a virtual environment, e.g.: python -m venv /path/to/venv . /path/to/venv/bin/activate pip install mypackage To exit the virtual environment, run: deactivate The virtual environment is not deleted, and can be re-entered by re-sourcing the activate file. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. Expected Results: Successful installation of the extension jupyterlab-sql-explorer. I acknowledge that I installed jupyter using a Gentoo package, but then ran the jupyter lab" command in a virtualized environment. This approach makes sense to me since keeping the Gentoo Python environment pristine should be paramount. Perhaps the Gentoo packages for the installation of jupyter presuppose Jupyter's ability to add additional extensions in Gentoo's main Python environment? If this is the case, I submit that the isolating Juypter in a virtual environment should be a preferred course, or at least an alternative.
I then existing my virtual environment in a a regular shell launched: jupyter labs and then I tried to install the same extension. I received this error message: Error when performing an action. Reason given: Error: error: externally-managed-environment × This environment is externally managed ?-> The system-wide Python installation in Gentoo should be maintained using the system package manager (e.g. emerge). If the package in question is not packaged for Gentoo, please consider installing it inside a virtual environment, e.g.: python -m venv /path/to/venv . /path/to/venv/bin/activate pip install mypackage To exit the virtual environment, run: deactivate The virtual environment is not deleted, and can be re-entered by re-sourcing the activate file. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. So the non-installation appears to be no dependent upon which Python environment the jupyter labs instance is started in. Here is the console from the regular system Python shell: (map) jlpoole@ryzdesk ~ $ deactivate jlpoole@ryzdesk ~ $ jupyter lab [I 2024-09-24 13:27:13.832 ServerApp] ipyparallel | extension was successfully linked. [I 2024-09-24 13:27:13.832 ServerApp] jupyter_lsp | extension was successfully linked. [I 2024-09-24 13:27:13.837 ServerApp] jupyter_server_terminals | extension was successfully linked. [I 2024-09-24 13:27:13.843 ServerApp] jupyterlab | extension was successfully linked. [W 2024-09-24 13:27:13.845 JupyterNotebookApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release. [W 2024-09-24 13:27:13.845 JupyterNotebookApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release. [W 2024-09-24 13:27:13.845 JupyterNotebookApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release. [I 2024-09-24 13:27:13.849 ServerApp] notebook | extension was successfully linked. [I 2024-09-24 13:27:13.852 ServerApp] notebook_shim | extension was successfully linked. [I 2024-09-24 13:27:13.867 ServerApp] notebook_shim | extension was successfully loaded. [I 2024-09-24 13:27:13.868 ServerApp] Loading IPython parallel extension [I 2024-09-24 13:27:13.868 ServerApp] ipyparallel | extension was successfully loaded. [I 2024-09-24 13:27:13.873 ServerApp] jupyter_lsp | extension was successfully loaded. [I 2024-09-24 13:27:13.874 ServerApp] jupyter_server_terminals | extension was successfully loaded. [I 2024-09-24 13:27:13.877 LabApp] JupyterLab extension loaded from /usr/lib/python3.12/site-packages/jupyterlab [I 2024-09-24 13:27:13.877 LabApp] JupyterLab application directory is /usr/share/jupyter/lab [I 2024-09-24 13:27:13.877 LabApp] Extension Manager is 'pypi'. [I 2024-09-24 13:27:13.922 ServerApp] jupyterlab | extension was successfully loaded. [I 2024-09-24 13:27:13.925 ServerApp] notebook | extension was successfully loaded. [I 2024-09-24 13:27:13.926 ServerApp] Serving notebooks from local directory: /home/jlpoole [I 2024-09-24 13:27:13.926 ServerApp] Jupyter Server 2.14.2 is running at: [I 2024-09-24 13:27:13.926 ServerApp] http://ryzdesk:8888/lab?token=eb521ac49cdf36b326a3de7266a831af4fe80f5c999dc9d1 [I 2024-09-24 13:27:13.926 ServerApp] http://127.0.0.1:8888/lab?token=eb521ac49cdf36b326a3de7266a831af4fe80f5c999dc9d1 [I 2024-09-24 13:27:13.926 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 2024-09-24 13:27:13.963 ServerApp] To access the server, open this file in a browser: file:///home/jlpoole/.local/share/jupyter/runtime/jpserver-14636-open.html Or copy and paste one of these URLs: http://ryzdesk:8888/lab?token=eb521ac49cdf36b326a3de7266a831af4fe80f5c999dc9d1 http://127.0.0.1:8888/lab?token=eb521ac49cdf36b326a3de7266a831af4fe80f5c999dc9d1 QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-jlpoole' QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-jlpoole' QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-jlpoole' [I 2024-09-24 13:27:14.152 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server Opening in existing browser session. [W 2024-09-24 13:27:16.351 LabApp] Could not determine jupyterlab build status without nodejs [I 2024-09-24 13:27:17.411 LabApp] `sys_prefix` level settings are read-only, using `user` level for migrationto `lockedExtensions` [I 2024-09-24 13:27:17.418 LabApp] `sys_prefix` level settings are read-only, using `user` level for migrationto `lockedExtensions` [I 2024-09-24 13:27:17.439 LabApp] `sys_prefix` level settings are read-only, using `user` level for migrationto `lockedExtensions` [E 2024-09-24 13:27:36.844 LabApp] Failed to installed jupyterlab-sql-explorer: code 1 error: externally-managed-environment × This environment is externally managed ?-> The system-wide Python installation in Gentoo should be maintained using the system package manager (e.g. emerge). If the package in question is not packaged for Gentoo, please consider installing it inside a virtual environment, e.g.: python -m venv /path/to/venv . /path/to/venv/bin/activate pip install mypackage To exit the virtual environment, run: deactivate The virtual environment is not deleted, and can be re-entered by re-sourcing the activate file. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. [E 2024-09-24 13:27:36.845 ServerApp] { "Host": "ryzdesk:8888", "Accept": "*/*", "Referer": "http://ryzdesk:8888/lab", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" } [E 2024-09-24 13:27:36.845 ServerApp] 500 POST /lab/api/extensions?1727209653496 (d4da36eb2c56459eb99f033eedb2aac8@127.0.0.1) 3346.96ms referer=http://ryzdesk:8888/lab ^C[I 2024-09-24 13:28:00.525 ServerApp] interrupted [I 2024-09-24 13:28:00.526 ServerApp] Serving notebooks from local directory: /home/jlpoole 0 active kernels Jupyter Server 2.14.2 is running at: http://ryzdesk:8888/lab?token=eb521ac49cdf36b326a3de7266a831af4fe80f5c999dc9d1 http://127.0.0.1:8888/lab?token=eb521ac49cdf36b326a3de7266a831af4fe80f5c999dc9d1 Shut down this Jupyter server (y/[n])? y [C 2024-09-24 13:28:01.654 ServerApp] Shutdown confirmed [I 2024-09-24 13:28:01.655 ServerApp] Shutting down 6 extensions jlpoole@ryzdesk ~ $ Here is the previous console that is within the virtual python session: (map) jlpoole@ryzdesk ~ $ jupyter lab [I 2024-09-24 09:36:05.142 ServerApp] ipyparallel | extension was successfully linked. [I 2024-09-24 09:36:05.142 ServerApp] jupyter_lsp | extension was successfully linked. [I 2024-09-24 09:36:05.147 ServerApp] jupyter_server_terminals | extension was successfully linked. [I 2024-09-24 09:36:05.153 ServerApp] jupyterlab | extension was successfully linked. [W 2024-09-24 09:36:05.155 JupyterNotebookApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release. [W 2024-09-24 09:36:05.155 JupyterNotebookApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release. [W 2024-09-24 09:36:05.155 JupyterNotebookApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release. [I 2024-09-24 09:36:05.159 ServerApp] notebook | extension was successfully linked. [I 2024-09-24 09:36:05.162 ServerApp] notebook_shim | extension was successfully linked. [I 2024-09-24 09:36:05.177 ServerApp] notebook_shim | extension was successfully loaded. [I 2024-09-24 09:36:05.179 ServerApp] Loading IPython parallel extension [I 2024-09-24 09:36:05.180 ServerApp] ipyparallel | extension was successfully loaded. [I 2024-09-24 09:36:05.184 ServerApp] jupyter_lsp | extension was successfully loaded. [I 2024-09-24 09:36:05.186 ServerApp] jupyter_server_terminals | extension was successfully loaded. [I 2024-09-24 09:36:05.188 LabApp] JupyterLab extension loaded from /usr/lib/python3.12/site-packages/jupyterlab [I 2024-09-24 09:36:05.188 LabApp] JupyterLab application directory is /usr/share/jupyter/lab [I 2024-09-24 09:36:05.189 LabApp] Extension Manager is 'pypi'. [I 2024-09-24 09:36:05.232 ServerApp] jupyterlab | extension was successfully loaded. [I 2024-09-24 09:36:05.236 ServerApp] notebook | extension was successfully loaded. [I 2024-09-24 09:36:05.236 ServerApp] Serving notebooks from local directory: /home/jlpoole [I 2024-09-24 09:36:05.236 ServerApp] Jupyter Server 2.14.2 is running at: [I 2024-09-24 09:36:05.236 ServerApp] http://ryzdesk:8888/lab?token=8509a5c8a8a93ff71ee541034225278ded3bd2e919764063 [I 2024-09-24 09:36:05.236 ServerApp] http://127.0.0.1:8888/lab?token=8509a5c8a8a93ff71ee541034225278ded3bd2e919764063 [I 2024-09-24 09:36:05.236 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 2024-09-24 09:36:05.275 ServerApp] To access the server, open this file in a browser: file:///home/jlpoole/.local/share/jupyter/runtime/jpserver-7614-open.html Or copy and paste one of these URLs: http://ryzdesk:8888/lab?token=8509a5c8a8a93ff71ee541034225278ded3bd2e919764063 http://127.0.0.1:8888/lab?token=8509a5c8a8a93ff71ee541034225278ded3bd2e919764063 QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-jlpoole' QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-jlpoole' QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-jlpoole' [I 2024-09-24 09:36:05.455 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server Opening in existing browser session. [W 2024-09-24 09:36:07.686 LabApp] Could not determine jupyterlab build status without nodejs [I 2024-09-24 09:36:08.825 LabApp] `sys_prefix` level settings are read-only, using `user` level for migrationto `lockedExtensions` [I 2024-09-24 09:36:08.833 LabApp] `sys_prefix` level settings are read-only, using `user` level for migrationto `lockedExtensions` [I 2024-09-24 09:36:08.854 LabApp] `sys_prefix` level settings are read-only, using `user` level for migrationto `lockedExtensions` [E 2024-09-24 12:40:05.898 LabApp] Failed to installed jupyterlab-sql-explorer: code 1 error: externally-managed-environment × This environment is externally managed ?-> The system-wide Python installation in Gentoo should be maintained using the system package manager (e.g. emerge). If the package in question is not packaged for Gentoo, please consider installing it inside a virtual environment, e.g.: python -m venv /path/to/venv . /path/to/venv/bin/activate pip install mypackage To exit the virtual environment, run: deactivate The virtual environment is not deleted, and can be re-entered by re-sourcing the activate file. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. [E 2024-09-24 12:40:05.899 ServerApp] { "Host": "ryzdesk:8888", "Accept": "*/*", "Referer": "http://ryzdesk:8888/lab", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" } [E 2024-09-24 12:40:05.899 ServerApp] 500 POST /lab/api/extensions?1727206802675 (d4da36eb2c56459eb99f033eedb2aac8@127.0.0.1) 3221.64ms referer=http://ryzdesk:8888/lab ^[[A^C[I 2024-09-24 13:26:36.165 ServerApp] interrupted [I 2024-09-24 13:26:36.165 ServerApp] Serving notebooks from local directory: /home/jlpoole 0 active kernels Jupyter Server 2.14.2 is running at: http://ryzdesk:8888/lab?token=8509a5c8a8a93ff71ee541034225278ded3bd2e919764063 http://127.0.0.1:8888/lab?token=8509a5c8a8a93ff71ee541034225278ded3bd2e919764063 Shut down this Jupyter server (y/[n])? y [C 2024-09-24 13:26:37.623 ServerApp] Shutdown confirmed [I 2024-09-24 13:26:37.624 ServerApp] Shutting down 6 extensions (map) jlpoole@ryzdesk ~ $ deactivate jlpoole@ryzdesk ~ $
Does running `pip install jupyterlab` or `pip install --user jupyterlab` while inside your virtual environment solve the problem?
(In reply to nvinson234 from comment #2) > Does running `pip install jupyterlab` or `pip install --user jupyterlab` > while inside your virtual environment solve the problem? Thank you, @nvinson234. Your suggestion seems good; however, given that I have installed the Gentoo package, I think it unwise to then try installing jupyterlab via a virtual environment when there is installed the Gentoo package. I could see uninstalling all the jupyter packages and then trying your suggestion so there is only one jupyter instance on the box. Before doing anything, I'd like to see what the package's maintainer or team overseeing that package has to suggest.
This is expected, installing python packages into the system sitedir with pip is disabled. Because having two package managers write to the same sitedir is a recipe for disaster. To solve your problem, either: - write an ebuild for jupyterlab-sql-explorer - pip install --user jupyterlab-sql-explorer (i.e. use portage's version of jupyterlab et al, while using a user install of jupyterlab-sql-explorer, this may break at some point) - use jupyterlab from virtualenv or --user sitedir instead, as already suggested above - enable the "break-system-packages" setting for pip, as suggested by the error message. As the name of this option suggests, this may break the system packages. Nothing further we can do here, there is no bug in jupyterlab, it is simply calling pip.
So the viable options I see are as follows: 1) Jupyter install using Gentoo's Jupyter packages. You can install extensions, but do so in a virtual environment specifying a user. However, installation of an extension in this fashion may result the extension no longer working in the future given potential upgrades within Gentoo's Jupyter packages. 2) Jupyter install within a virtual environment. Keep the Jupyter isolated in the virtual environment as well as any extensions. Seems to me that the above two choices (realistic as the other "break" something) whittle down to: If you plan to use extensions currently not available in Gentoo, then build Jupyter in a virtual environment. If you expect to only use what is currently available in portage, then use the Jupyter package. Thank you. I think I'll purse the #2 route and keep my options open in case there are other extensions I want to try.