Faith Ogundimu
Faith Ogundimu

Reputation: 1

Trying to Run a Jupyter Notebook inside a Container Inside a Remote Server -

When running the code I am met with ModuleNotFoundError: No module named 'urllib3.util.wait'

urrlib is a package that is inside the container and built into the remote server's compute node also.

[u102501@mel0158 get_BIO1018]$ module load Apptainer/1.2.4-GCCcore-12.3.0

[u102501@mel0158 get_BIO1018]$ apptainer exec --bind /project/home/xxxxxx/get_BIO1018:/home/xf2217 get_complete_latest.sif jupyter notebook --allow-root --ip 0.0.0.0 --no-browser --NotebookApp.token='' --NotebookApp.password='' --notebook-dir=/home/xf2217

Error:

Traceback (most recent call last):
  File "/opt/conda/bin/jupyter-lab", line 6, in <module>
    from jupyterlab.labapp import main
  File "/opt/conda/lib/python3.12/site-packages/jupyterlab/__init__.py", line 8, in <module>
    from .handlers.announcements import (
  File "/opt/conda/lib/python3.12/site-packages/jupyterlab/handlers/announcements.py", line 15, in <module>
    from jupyterlab_server.translation_utils import translator
  File "/opt/conda/lib/python3.12/site-packages/jupyterlab_server/__init__.py", line 6, in <module>
    from .app import LabServerApp
  File "/opt/conda/lib/python3.12/site-packages/jupyterlab_server/app.py", line 15, in <module>
    from .handlers import LabConfig, add_handlers
  File "/opt/conda/lib/python3.12/site-packages/jupyterlab_server/handlers.py", line 21, in <module>
    from .listings_handler import ListingsHandler, fetch_listings
  File "/opt/conda/lib/python3.12/site-packages/jupyterlab_server/listings_handler.py", line 10, in <module>
    import requests
  File "/opt/conda/lib/python3.12/site-packages/requests/__init__.py", line 43, in <module>
    import urllib3
  File "/home/users/u102501/.local/lib/python3.12/site-packages/urllib3/__init__.py", line 13, in <module>
    from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
  File "/home/users/u102501/.local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 13, in <module>
    from .connection import (
  File "/home/users/u102501/.local/lib/python3.12/site-packages/urllib3/connection.py", line 15, in <module>
    from .util.proxy import create_proxy_ssl_context
  File "/home/users/u102501/.local/lib/python3.12/site-packages/urllib3/util/__init__.py", line 4, in <module>
    from .connection import is_connection_dropped
  File "/home/users/u102501/.local/lib/python3.12/site-packages/urllib3/util/connection.py", line 8, in <module>
    from .wait import NoWayToWaitForSocketError, wait_for_read
ModuleNotFoundError: No module named 'urllib3.util.wait'
srun: error: mel0158: task 0: Exited with exit code 1

I've tried reinstalling urrlib3 both in the container and outside and the likes based on previous forums.

My remote server does not allow Docker only, Singularity/Apptainer

Upvotes: -1

Views: 30

Answers (1)

Faith Ogundimu
Faith Ogundimu

Reputation: 1

Figured it out:

Solution:

module load Python/3.11.3-GCCcore-12.3.0 
rm -rf /home/users/u102501/.local/lib/python3.12/site-packages/urllib3*
python -m pip install --upgrade --force-reinstall urllib3
python -c "import urllib3; print(urllib3.__version__)"
apptainer exec --bind /project/home/xxxxxx/get_BIO1018 get_complete_latest.sif python -m jupyter lab --no-browser --ip "*" --NotebookApp.token='' --NotebookApp.password='' --notebook-dir /project/home/xxxxxx/get_BIO1018 --port 8888

Split terminal screen:

In local machine:

ssh -L 8888:localhost:8888 [email protected] -p 8822 -i ~/.ssh/id_ed25519_mlux

Enter passphrase,

Then,

ssh -L 8888:localhost:8888 <mel0000> swap <> for your node.

Upvotes: 0

Related Questions