jupyterhub / jupyterhub-deploy-docker

Reference deployment of JupyterHub with docker
BSD 3-Clause "New" or "Revised" License
701 stars 368 forks source link

build failed "No module named 'conda'" #107

Closed juleslagarde closed 1 year ago

juleslagarde commented 3 years ago

description

build failed

context:

how to reproduce

  1. git clone https://github.com/jupyterhub/jupyterhub-deploy-docker
  2. mkdir secrets
  3. echo -e admin admin > secrets/userlist
  4. generate self signed key/cert:
    • openssl genrsa 2048 > server.key
    • chmod 400 server.key
    • openssl req -new -x509 -nodes -sha256 -days 365 -key server.key -out server.crt
  5. make build

logs

> make build
Generating postgres password in secrets/postgres.env
fa0f2834b7b97136c8539fc21aaf25fdc9a07b2c14fb6a2a257278654c4b1a6e
jupyterhub-data
jupyterhub-db-data
docker-compose build
hub-db uses an image, skipping
Building hub
Sending build context to Docker daemon  295.4kB
Step 1/9 : ARG JUPYTERHUB_VERSION
Step 2/9 : FROM jupyterhub/jupyterhub-onbuild:$JUPYTERHUB_VERSION
0.9.2: Pulling from jupyterhub/jupyterhub-onbuild
c64513b74145: Pull complete
01b8b12bad90: Pull complete
c5d85cf7a05f: Pull complete
b6b268720157: Pull complete
e12192999ff1: Pull complete
256ccce151e7: Pull complete
f0d04906c48f: Pull complete
3f8d9ed60d29: Pull complete
9a4e3ab6e62d: Pull complete
39d4f72bd19a: Pull complete
Digest: sha256:c44611b52a3a64494ba51cf4f2abb2cbc17ceba325e5fe172be80c6e6c3a5be8
Status: Downloaded newer image for jupyterhub/jupyterhub-onbuild:0.9.2
# Executing 1 build trigger
 ---> 119c8c9149d7
Step 3/9 : RUN /opt/conda/bin/conda install -yq psycopg2=2.7 &&     /opt/conda/bin/conda clean -tipsy &&     /opt/conda/bin/pip install --no-cache-dir         jupyterhub-dummyauthenticator         dockerspawner==12.0.*
 ---> Running in 65a57f248a0d
Solving environment: ...working... done

## Package Plan ##

  environment location: /opt/conda

  added / updated specs:
    - psycopg2=2.7

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    libstdcxx-ng-9.3.0         |      hd4cf53a_17         4.0 MB
    ca-certificates-2021.5.25  |       h06a4308_1         118 KB
    libffi-3.2.1               |    hf484d3e_1007          52 KB
    openssl-1.1.1k             |       h27cfd23_0         3.8 MB
    ncurses-6.2                |       he6710b0_1         1.1 MB
    libgomp-9.3.0              |      h5101ec6_17         378 KB
    psycopg2-2.7.6.1           |   py37h1ba5d50_0         308 KB
    readline-7.0               |       h7b6447c_5         392 KB
    wheel-0.36.2               |     pyhd3eb1b0_0          31 KB
    zlib-1.2.11                |       h7b6447c_3         120 KB
    libpq-11.2                 |       h20c2e04_0         2.7 MB
    pip-21.1.2                 |   py37h06a4308_0         2.0 MB
    _libgcc_mutex-0.1          |             main           3 KB
    setuptools-52.0.0          |   py37h06a4308_0         921 KB
    ld_impl_linux-64-2.35.1    |       h7274673_9         637 KB
    krb5-1.16.4                |       h173b8e3_0         1.4 MB
    sqlite-3.33.0              |       h62c20be_0         2.0 MB
    libedit-3.1.20210216       |       h27cfd23_1         190 KB
    certifi-2021.5.30          |   py37h06a4308_0         141 KB
    xz-5.2.5                   |       h7b6447c_0         438 KB
    libgcc-ng-9.3.0            |      h5101ec6_17         7.8 MB
    python-3.7.7               |h191fe78_0_cpython        52.6 MB
    _openmp_mutex-4.5          |            1_gnu          22 KB
    ------------------------------------------------------------
                                           Total:        81.0 MB

The following NEW packages will be INSTALLED:

    _libgcc_mutex:    0.1-main
    _openmp_mutex:    4.5-1_gnu
    krb5:             1.16.4-h173b8e3_0
    ld_impl_linux-64: 2.35.1-h7274673_9
    libgomp:          9.3.0-h5101ec6_17
    libpq:            11.2-h20c2e04_0
    psycopg2:         2.7.6.1-py37h1ba5d50_0

The following packages will be UPDATED:

    ca-certificates:  2018.4.16-0             conda-forge --> 2021.5.25-h06a4308_1
    certifi:          2018.8.13-py36_0        conda-forge --> 2021.5.30-py37h06a4308_0
    decorator:        4.3.0-py_0              conda-forge --> 4.3.0-py_0               conda-forge
    ipython_genutils: 0.2.0-py_1              conda-forge --> 0.2.0-py_1               conda-forge
    jinja2:           2.10-py_1               conda-forge --> 2.10-py_1                conda-forge
    libedit:          3.1.20170329-haf1bffa_1 conda-forge --> 3.1.20210216-h27cfd23_1
    libffi:           3.2.1-hd88cf55_4                    --> 3.2.1-hf484d3e_1007
    libgcc-ng:        7.2.0-hdf63c60_3                    --> 9.3.0-h5101ec6_17
    libstdcxx-ng:     7.2.0-hdf63c60_3                    --> 9.3.0-hd4cf53a_17
    ncurses:          6.1-hfc679d8_1          conda-forge --> 6.2-he6710b0_1
    openssl:          1.0.2o-h470a237_1       conda-forge --> 1.1.1k-h27cfd23_0
    pip:              18.0-py36_1             conda-forge --> 21.1.2-py37h06a4308_0
    python:           3.6.6-h5001a0f_0        conda-forge --> 3.7.7-h191fe78_0_cpython
    readline:         7.0-ha6073c6_4                      --> 7.0-h7b6447c_5
    setuptools:       39.0.1-py36_0                       --> 52.0.0-py37h06a4308_0
    sqlite:           3.24.0-h2f33b56_0       conda-forge --> 3.33.0-h62c20be_0
    wheel:            0.31.0-py36_0                       --> 0.36.2-pyhd3eb1b0_0
    xz:               5.2.3-h55aa19d_2                    --> 5.2.5-h7b6447c_0
    zlib:             1.2.11-ha838bed_2                   --> 1.2.11-h7b6447c_3

Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working...
done
Traceback (most recent call last):
  File "/opt/conda/bin/conda", line 7, in <module>
    from conda.cli import main
ModuleNotFoundError: No module named 'conda'
The command '/bin/sh -c /opt/conda/bin/conda install -yq psycopg2=2.7 &&     /opt/conda/bin/conda clean -tipsy &&     /opt/conda/bin/pip install --no-cache-dir         jupyterhub-dummyauthenticator         dockerspawner==12.0.*' returned a non-zero code: 1
ERROR: Service 'hub' failed to build : Build failed
make: *** [build] Error 1
TomTorger commented 3 years ago

I get the exact same error on ubuntu 20.04.

vukor commented 3 years ago

Same error on mac

closedLoop commented 3 years ago

Same as this issue: https://github.com/jupyterhub/jupyterhub-deploy-docker/issues/91

HiloadProgrammer commented 3 years ago

In Dockerfile.jupyterhub the line RUN /opt/conda/bin/conda install -yq psycopg2=2.7 updates the python version from 3.6.6 to 3.7.. Therefore you will get a similar error as Conda #9672: No module named 'conda' . To fix this issue I added the line `RUN echo "python 3.6." > /opt/conda/conda-meta/pinnedbefore I installedpsycopg2` to pin the python version.

nrgpy commented 2 years ago

@HiloadProgrammer this worked for me (and apparently 3 others). should i submit a pull request to have the Dockerfile.jupyterhub file updated, or is there another fix in the works?

HiloadProgrammer commented 2 years ago

@HiloadProgrammer this worked for me (and apparently 3 others). should i submit a pull request to have the Dockerfile.jupyterhub file updated, or is there another fix in the works?

@nrgpy I see this solution more as a quick fix rather than a permanent solution. Currently I am not working on this issue therefore there is no other fix that I know about.

If you like you can submit this fix.

manics commented 1 year ago

This was updated!