jupyterhub / the-littlest-jupyterhub

Simple JupyterHub distribution for 1-100 users on a single server
https://tljh.jupyter.org
BSD 3-Clause "New" or "Revised" License
1.04k stars 341 forks source link

Using JupyterLab extensions with TLJH JupyterLab Build suggested #440

Closed bhope78 closed 3 years ago

bhope78 commented 5 years ago

Hello I am not sure where to go with this now, tried enabling a couple extensions but received a Jupyterlab build error

Build Recommended
JupyterLab build is suggested:
@jupyterlab/plotly-extension needs to be included in build

After an attempting build I get this error:

Build Failed
Build failed with 500, please run 'jupyter lab build' on the server for full output

I tried to different build methods with the following errors

jupyterlab build

Message: 'Error in rmtree'
Arguments: ()
An error occured.
FileExistsError: [Errno 17] File exists: '/opt/tljh/user/share/jupyter/lab/staging'
See the log file for details:  /tmp/jupyterlab-debug-xcu1cdjw.log

/opt/tljh/user/share/jupyter/lab/staging$
build  index.js  linked_packages  node_modules  package.json  templates  webpack.config.js  webpack.prod.config.js  yarn.js  yarn.lock

[LabBuildApp] Building in /opt/tljh/user/share/jupyter/lab
[LabBuildApp] Node v12.8.1

[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
[LabBuildApp] Traceback (most recent call last):

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/labapp.py", line 96, in start
    core_config=self.core_config)

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/commands.py", line 378, in build
    command=command, clean_staging=clean_staging)

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/commands.py", line 564, in build
    clean=clean_staging

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/commands.py", line 1010, in _populate_staging
    os.makedirs(staging)

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)

[LabBuildApp] FileExistsError: [Errno 17] File exists: '/opt/tljh/user/share/jupyter/lab/staging'

[LabBuildApp] Exiting application: JupyterLab

**jupyterlab-build**
output
Message: 'Error in rmtree'
Arguments: ()
An error occured.
FileExistsError: [Errno 17] File exists: '/opt/tljh/user/share/jupyter/lab/staging'
See the log file for details:  /tmp/jupyterlab-debug-3onmje93.log

LabBuildApp] Building in /opt/tljh/user/share/jupyter/lab
[LabBuildApp] Node v12.8.1

[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
[LabBuildApp] Traceback (most recent call last):

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/labapp.py", line 96, in start
    core_config=self.core_config)

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/commands.py", line 378, in build
    command=command, clean_staging=clean_staging)

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/commands.py", line 564, in build
    clean=clean_staging

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/commands.py", line 1010, in _populate_staging
    os.makedirs(staging)

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)

[LabBuildApp] FileExistsError: [Errno 17] File exists: '/opt/tljh/user/share/jupyter/lab/staging'

[LabBuildApp] Exiting application: JupyterLab
(base) jupyter-bryana@rstudio-ubuntu-s-1vcpu-2gb-sfo2-01:/tmp$ cat /tmp/jupyterlab-debug-3onmje93.log
[LabBuildApp] Building in /opt/tljh/user/share/jupyter/lab
[LabBuildApp] Node v12.8.1

[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
[LabBuildApp] Traceback (most recent call last):

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/labapp.py", line 96, in start
    core_config=self.core_config)

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/commands.py", line 378, in build
    command=command, clean_staging=clean_staging)

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/commands.py", line 564, in build
    clean=clean_staging

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/site-packages/jupyterlab/commands.py", line 1010, in _populate_staging
    os.makedirs(staging)

[LabBuildApp]   File "/opt/tljh/user/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)

[LabBuildApp] FileExistsError: [Errno 17] File exists: '/opt/tljh/user/share/jupyter/lab/staging'

[LabBuildApp] Exiting application: JupyterLab
dschofield commented 5 years ago

I'm working through Jupyter Lab extension build issues myself right now, so I'll add details of anything that works for me as I come across them. What versions of the various Jupyter components do you have?

$ sudo pip freeze | grep jupyt
jupyter==1.0.0
jupyter-client==5.3.3
jupyter-console==6.0.0
jupyter-core==4.5.0
jupyterhub==1.0.0
jupyterlab==1.1.4
jupyterlab-server==1.0.6
nteract-on-jupyter==2.0.7
PaulJXu commented 4 years ago

I have the similar problem. I cannot install and update extension in jupyterlab. Could you help me?

calz1 commented 4 years ago

On a fresh install from yesterday, I get this same issue but I haven't installed any extensions. I'm warned I need to do a build and then the build fails from the UI or terminal.

_--- Logging error --- Traceback (most recent call last): File "/opt/tljh/user/lib/python3.7/shutil.py", line 493, in rmtree os.rmdir(path) PermissionError: [Errno 13] Permission denied: '/opt/tljh/user/share/jupyter/lab/staging'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/tljh/user/lib/python3.7/logging/init.py", line 1034, in emit msg = self.format(record) File "/opt/tljh/user/lib/python3.7/logging/init.py", line 880, in format return fmt.format(record) File "/opt/tljh/user/lib/python3.7/site-packages/traitlets/config/application.py", line 117, in format return super(LevelFormatter, self).format(record) File "/opt/tljh/user/lib/python3.7/logging/init.py", line 627, in format record.exc_text = self.formatException(record.exc_info) File "/opt/tljh/user/lib/python3.7/logging/init.py", line 577, in formatException traceback.print_exception(ei[0], ei[1], tb, None, sio) File "/opt/tljh/user/lib/python3.7/traceback.py", line 104, in print_exception type(value), value, tb, limit=limit).format(chain=chain): File "/opt/tljh/user/lib/python3.7/traceback.py", line 476, in init if (exc_value and exc_value.cause is not None AttributeError: 'str' object has no attribute 'cause' Call stack: File "/opt/tljh/user/bin/jupyter-lab", line 10, in sys.exit(main()) File "/opt/tljh/user/lib/python3.7/site-packages/jupyter_core/application.py", line 270, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) File "/opt/tljh/user/lib/python3.7/site-packages/traitlets/config/application.py", line 664, in launch_instance app.start() File "/opt/tljh/user/lib/python3.7/site-packages/notebook/notebookapp.py", line 1910, in start super(NotebookApp, self).start() File "/opt/tljh/user/lib/python3.7/site-packages/jupyter_core/application.py", line 259, in start self.subapp.start() File "/opt/tljh/user/lib/python3.7/site-packages/jupyterlab/labapp.py", line 98, in start command=command, app_options=app_options) File "/opt/tljh/user/lib/python3.7/site-packages/jupyterlab/commands.py", line 459, in build command=command, clean_staging=clean_staging) File "/opt/tljh/user/lib/python3.7/site-packages/jupyterlab/commands.py", line 650, in build clean=clean_staging File "/opt/tljh/user/lib/python3.7/site-packages/jupyterlab/commands.py", line 1095, in _populate_staging _rmtree(staging, self.logger) File "/opt/tljh/user/lib/python3.7/site-packages/jupyterlab/commands.py", line 1814, in _rmtree shutil.rmtree(path, onerror=onerror) File "/opt/tljh/user/lib/python3.7/shutil.py", line 495, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/opt/tljh/user/lib/python3.7/site-packages/jupyterlab/commands.py", line 1812, in onerror logger.debug('Error in rmtree', exc_info=excinfo) Message: 'Error in rmtree' Arguments: () An error occured. FileExistsError: [Errno 17] File exists: '/opt/tljh/user/share/jupyter/lab/staging' See the log file for details: /tmp/jupyterlab-debug-kl04yyqa.log

slipb commented 4 years ago

Normally installation by click will not work.you have to install it by CMD line at terminal in Jupyter Please remenber sudo -Ebefore any installation

consideRatio commented 3 years ago

Indeed sudo -E need to be used to make changes about this, so perhaps sudo -E jupyter lab build ?

I'll close this as a bit too outdated at this point to keep tracking in this issue. I see no concrete action point to take with regards to changing content in docs or TLJH itself at this point.

timhuff commented 2 years ago

Thanks @consideRatio. I was aware of the sudo -E thing but unaware that jupyter lab build was necessary.

consideRatio commented 2 years ago

@timhuff note that jupyter lab build is only relevant for jupyterlab 2 or jupyterlab 2 specific extensions you have installed. JupyterLab 3+ doesn't need that.