I have started to experience an issue with installing extensions for Jupyterlab that I have not experienced in the past. I am not able to build after installing new extensions for Jupyterlab.
I am running Jupyterlab with GCP AI Platform Notebooks. I am using the standard Python 3 environment on Debian 10. I have tried to run on different types of machines.
I am receiving a status 500 error. Here is the log from when I run jupyter lab build
:
[LabBuildApp] WARNING | Config option `kernel_spec_manager_class` not recognized by `LabBuildApp`.
[LabBuildApp] JupyterLab 1.2.16
[LabBuildApp] Building in /opt/conda/share/jupyter/lab
[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
An error occured.
PermissionError: [Errno 1] Operation not permitted: '/opt/conda/share/jupyter/lab/staging/index.js'
See the log file for details: /tmp/jupyterlab-debug-pnbu3naq.log
Here is the log file with details:
[LabBuildApp] Building in /opt/conda/share/jupyter/lab
[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Node v15.3.0
[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
[LabBuildApp] Traceback (most recent call last):
[LabBuildApp] File "/opt/conda/lib/python3.7/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
yield
[LabBuildApp] File "/opt/conda/lib/python3.7/site-packages/jupyterlab/labapp.py", line 98, in start
command=command, app_options=app_options)
[LabBuildApp] File "/opt/conda/lib/python3.7/site-packages/jupyterlab/commands.py", line 459, in build
command=command, clean_staging=clean_staging)
[LabBuildApp] File "/opt/conda/lib/python3.7/site-packages/jupyterlab/commands.py", line 650, in build
clean=clean_staging
[LabBuildApp] File "/opt/conda/lib/python3.7/site-packages/jupyterlab/commands.py", line 1103, in _populate_staging
shutil.copy(pjoin(HERE, 'staging', fname), target)
[LabBuildApp] File "/opt/conda/lib/python3.7/shutil.py", line 249, in copy
copymode(src, dst, follow_symlinks=follow_symlinks)
[LabBuildApp] File "/opt/conda/lib/python3.7/shutil.py", line 144, in copymode
chmod_func(dst, stat.S_IMODE(st.st_mode))
[LabBuildApp] PermissionError: [Errno 1] Operation not permitted: '/opt/conda/share/jupyter/lab/staging/index.js'
[LabBuildApp] Exiting application: JupyterLab
Since I have been able to install the same extensions for Jupyterlab in the past on other VM instances I would expect it has something to do with the version of Jupyterlab that is installed. I would, however, expect that Google would install the latest version of Jupyterlab.
The error log does seem to indicate that it is a permission error, which I don’t understand as I am running the jupyter lab build
at base. The only setting I have changed after creating the instance is to enable extensions.
3
Answers
You need to compile jupyter-lab as root. It’s less intuitive because
jupyter
is not included in$PATH
for the root user.Here’s what to do:
AI Platform Notebooks are running an old version of JupyterLab. It is hard to install plugins when running an old version. You’ll need to move off AI Platform Notebooks or wait until AI Platform Notebooks upgrades to a new version.
AI Platform Notebooks is running 1.x, and the current version is 3.x.
This is how it proceeded for me.
After I saw this error in the log I included additional options like this.