jupyter-lmod
                                
                                
                                
                                    jupyter-lmod copied to clipboard
                            
                            
                            
                        Error loading server extension jupyterlmod
Hi, Please help us to resolve the issue, eventhough jupyter-serverextension is OK, i am getting this issue.
[root@master jupyterhub]# jupyter-labextension list
JupyterLab v2.2.0
Known labextensions:
   app dir: /share/apps/platform/ai/python_versions/python3/3_6_8/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager v2.0.0  enabled  OK
        @jupyterlab/github v2.0.0  enabled  OK
        jupyterlab-control v1.1.1  enabled  OK
        jupyterlab-drawio v0.7.0  enabled  OK
        jupyterlab-lmod v0.8.1  enabled  OK
        jupyterlab-logout v0.5.0  enabled  OK
        jupyterlab-python-file v0.4.0  enabled  OK
        jupyterlab-topbar-extension v0.5.0  enabled  OK
[root@master jupyterhub]# jupyter-serverextension list config dir: /share/apps/platform/ai/python_versions/python3/3_6_8/etc/jupyter jupyterlab enabled - Validating... jupyterlab 2.2.0 OK jupyterlmod enabled - Validating... jupyterlmod OK nbresuse enabled - Validating... nbresuse OK [root@master jupyterhub]#
and i have added below code with respect to the jupyterhub_lmod on  jupyterhub_config.py
c.Spawner.env_keep = [ 'LMOD_CMD', 'MODULEPATH' 'PATH' 'PYTHONPATH', 'CONDA_ROOT', 'CONDA_DEFAULT_ENV', 'VIRTUAL_ENV', 'LANG', 'LC_ALL', 'JUPYTERHUB_SINGLEUSER_APP', ]
Logs:
Sep  1 11:41:15 master jupyterhub: [I 2021-09-01 11:41:15.662 SingleUserNotebookApp extension:162] JupyterLab extension loaded from /share/apps/platform/ai/python_versions/python3/3_6_8/lib/python3.6/site-packages/jupyterlab
Sep  1 11:41:15 master jupyterhub: [I 2021-09-01 11:41:15.663 SingleUserNotebookApp extension:163] JupyterLab application directory is /share/apps/platform/ai/python_versions/python3/3_6_8/share/jupyter/lab
Sep  1 11:41:15 master jupyterhub: [W 2021-09-01 11:41:15.674 SingleUserNotebookApp notebookapp:1950] Error loading server extension jupyterlmod
Sep  1 11:41:15 master jupyterhub: Traceback (most recent call last):
Sep  1 11:41:15 master jupyterhub: File "/share/apps/platform/ai/python_versions/python3/3_6_8/lib/python3.6/site-packages/notebook/notebookapp.py", line 1942, in init_server_extensions
Sep  1 11:41:15 master jupyterhub: mod = importlib.import_module(modulename)
Sep  1 11:41:15 master jupyterhub: File "/share/apps/platform/ai/python_versions/python3/3_6_8/lib/python3.6/importlib/init.py", line 126, in import_module
Sep  1 11:41:15 master jupyterhub: return _bootstrap._gcd_import(name[level:], package, level)
Sep  1 11:41:15 master jupyterhub: File "
Regards,
zain
                                    
                                    
                                    
                                
The value of LMOD_CMD is not defined when the notebook is launched.
Sep  1 11:41:15 master jupyterhub: KeyError: 'LMOD_CMD'
Is it correctly defined when you launch the JupyterHub service?
In my configuration I used c.Spawner.environment setting
c.Spawner.environment = {'LMOD_CMD' : '/path/to/lmod', 'MODULEPATH' : '/path/to/modulepath'}