Jupyterhub (conda-forge) offline installation

Hello all,

Issue
My company recently did lot of security patches. I am not able to perform conda install without setting HTTP_PROXY in .condarc file, which turns out to be taking a long time.

I’d like to see if I can do offline installation.

My Env
RHEL 8.3.1-5

Conda Envs
/app/jupyterlab/anaconda3Current
/app/jupyterlab/anaconda3Lab

Python

/app/jupyterlab/anaconda3Current/bin/python --version
Python 3.12.7

Reproducing Error

sudo /app/jupyterlab/anaconda3Current/bin/conda install -p /app/jupyterlab/anaconda3Lab -c conda-forge jupyterhub

CondaSSLError: Encountered an SSL error. Most likely a certificate verification issue.

Exception: HTTPSConnectionPool(host=‘conda.anaconda.org’, port=443): Max retries exceeded with url: /conda-forge/linux-64/repodata.json.zst (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)’)))

What I tried so far

  1. Add --insecure parameter (Equivalent to setting ‘ssl_verify’ to ‘false’).

Error Message

Collecting package metadata (repodata.json): failed

CondaHTTPError: HTTP 401 UNAUTHORIZED for url https://conda.anaconda.org/conda-forge/linux-64/repodata.json
Elapsed: 00:00.083223

The remote server has indicated you are using invalid credentials for this channel.

  1. Try to install one of the dependencies offline (alembic)
  • Download the .conda file from conda-forge website
  • Copy it to a random location
  • Run below command (with -c and --override-channels pars)

sudo /app/jupyterlab/anaconda3Current/bin/conda install -p /app/jupyterlab/anaconda3Lab -c /mapr/<…>/app/channel alembic --override-channels

Error Message

UnavailableInvalidChannel: HTTP 404 UNAVAILABLE OR INVALID for channel channel <file:///mapr/…/app/channel>

The channel is not accessible or is invalid.

Where am I making mistakes?
How can I install all jupyterhub dependencies offline?

Appreciate any help / words of wisdom anyone can share.
Thanks much

There shouldn’t be anything specific to JupyterHub about doing this, since it should be the same for any package on conda-forge.

conda install has an --offline flag, which should prevent talking to anaconda.org.

The UnavailableInvalidChannel error suggests that /mapr/<…>/app/channel is not a valid package index directory. What is in this directory? There should be either a repodata.json or a channeldata.json.

conda-pack is also a tool that lets you bundle up an environment as a single archive you can distribute and install entirely offline. I’m not sure if that suits your use case.