How to install prebuilt jupyterlab extension on Windows with the --user option?

Hi everyone,

I’m trying to install the python package plotly to use in JupyterLab. It comes with a prebuilt extension, which is automatically installed when running pip install plotly --user, but it does not work correctly.

Operating system is Windows 10.

I don’t have access to the system-wide installation in C:\Program Files\Python39, since it is a corporate device. However, I can install packages with the --user option and they will end up in %APPDATA%\Python\. So far everything works fine.

The problem is, that when installing with the --user flag, the jupyterlab extension gets installed in %AppData%\Python\share instead of C:\Program Files\Python39\share. However, JupyterLab looks for extensions under the sys.prefix, which is the system location. The detailed documentation can be found here.

Is there any way to make JupyterLab detect extension stored in %AppData%\Python\share or any other writeable location?

Other points to consider:

  • I don’t want to work with a virtual environment.
  • I’ve already been in contact with the plotly developers, but as the system-wide installation is read-only, there is no way for them to install the extension there.

Thanks for your help.

Best regards
Stephan

Can you try upgrading the jupyter_core package to the latest version, version 4.9.1? There were several recent fixes in it dealing with finding packages installed with --user on Windows (see Changes in jupyter-core — jupyter_core 4.9.1 documentation).

2 Likes

Upgrading to jupyter-core==4.9.1 solved the issue. Thank you very much for that pointer.

Best regards
Stephan

1 Like