Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

genv-help: command not found #15

Closed
InCogNiTo124 opened this issue Dec 15, 2022 · 8 comments
Closed

genv-help: command not found #15

InCogNiTo124 opened this issue Dec 15, 2022 · 8 comments

Comments

@InCogNiTo124
Copy link

Installed in a jupyterhub/singleuser:3.1.0 docker container with conda install -y -c conda-forge genv

running genv, genv config, genv activate returns:

genv-help: command not found
@InCogNiTo124
Copy link
Author

version: latest

@razrotenberg
Copy link
Member

Hi @InCogNiTo124 !
So sorry for the late reply, truth is that for some reason I wasn't notified about this issue so I just didn't see it 😅
I reran the Docker image and the conda install command.
Then, running genv command works for me so unfortunately I'm unable to reproduce the issue.

I wonder if it was a problem in a previous version of Genv and now it is solved.
Do you mind trying the same thing once again and making sure genv is of version 0.4.0?
You can verify the version using the command conda list | grep genv.

If this still fails, can you run the following commands and share their outputs here:

  1. which genv
  2. type genv
  3. ls -la /opt/conda/bin/genv
  4. ls -la /opt/conda/opt/genv/
  5. conda list | grep genv

Waiting for hearing from you and thanks for reaching out!

@InCogNiTo124
Copy link
Author

hey @razrotenberg!

Unfortunately the issue persists for me. This is our Dockerfile:

FROM jupyterhub/singleuser:3.1.0
RUN apt update && apt install -y ffmpeg libsm6 libxext6 git
RUN conda install -y -c conda-forge genv jupyterlab_genv

building the image with docker buildx build --no-cache -t singleuser . and accesing JupyterLab through JupyterHub, but it isn't resolved. Here are the command outputs:

msmetko@5ef780f06b03:~/work$ which genv
/opt/conda/bin/genv
msmetko@5ef780f06b03:~/work$ type genv
genv is hashed (/opt/conda/bin/genv)
msmetko@5ef780f06b03:~/work$ ls -la /opt/conda/bin/genv
lrwxrwxrwx 1 root users 24 Jan 13 12:17 /opt/conda/bin/genv -> ../opt/genv/libexec/genv
msmetko@5ef780f06b03:~/work$ ls -la /opt/conda/opt/genv/
total 112
drwxr-sr-x 11 root users  4096 Jan 13 12:17 .
drwxr-sr-x  3 root users  4096 Jan 13 12:17 ..
-rwxrwxr-x  2 root root     68 Dec 22 20:48 .bashrc
drwxr-sr-x  2 root users  4096 Jan 13 12:17 bin
-rw-rw-r--  1 root users  2478 Jan 13 12:17 build_env_setup.sh
-rwxrwxrwx  2 root root    444 Dec 22 20:56 conda_build.sh
drwxr-sr-x  3 root users  4096 Jan 13 12:17 docs
drwxr-sr-x  2 root users  4096 Jan 13 12:17 exe
-rw-rw-r--  2 root root     92 Dec 22 20:48 .flake8
drwxr-sr-x  3 root users  4096 Jan 13 12:17 .github
-rw-rw-r--  2 root root     42 Dec 22 20:48 .gitignore
drwxr-sr-x  2 root users  4096 Jan 13 12:17 images
drwxr-sr-x  2 root users  4096 Jan 13 12:17 libexec
-rw-rw-r--  2 root root  34523 Dec 22 20:48 LICENSE
-rw-rw-r--  2 root root    842 Dec 22 20:56 metadata_conda_debug.yaml
drwxr-sr-x  2 root users  4096 Jan 13 12:17 py
-rw-rw-r--  2 root root   5331 Dec 22 20:48 README.md
drwxr-sr-x  2 root users  4096 Jan 13 12:17 shims
drwxr-sr-x  2 root users  4096 Jan 13 12:17 .vscode
msmetko@5ef780f06b03:~/work$ conda list | grep genv
genv                      0.4.0                ha770c72_0    conda-forge
jupyterlab_genv           0.1.2              pyhd8ed1ab_0    conda-forge

@InCogNiTo124
Copy link
Author

However, I sort of managed to make it run with this:

msmetko@5ef780f06b03:~/work$ /opt/conda/opt/genv/bin/genv
Usage: genv <command>

Available commands:
    activate      Activate environment
    attach        Attach devices to this environment
    commands      List all available genv commands
    config        Configure this environment
    deactivate    Deactivate environment
    detach        Detach devices from this environment
    devices       Print information of devices
    envs          Print information of active environments
    exec          Run a genv executable
    help          Print this help message
    home          Display the directory containing the configuration of this environment
    init          Add genv support to your shell
    remote        Query genv on remote hosts
    root          Display the root directory where genv is installed
    status        Show status of the current environment

@razrotenberg
Copy link
Member

I'm trying to reproduce what you are seeing.
For some reason I can't build the Docker image with the Dockerfile and command that you shared here 🤷

I have another question though, how do you run the bash inside the container?
I wonder if it's something related to this because part of the Genv installation in Conda is the initialization of the shell.
It might be something with the container entrypoint/command that the shell is not initialized properly.

Can you please try running the following command and then check if genv works properly?

source /opt/conda/etc/conda/activate.d/genv_activate.sh

@InCogNiTo124
Copy link
Author

Sorry for the delay! Work got in the way ://

Running the command above resulted with:

$ source /opt/conda/etc/conda/activate.d/genv_activate.sh
No such command 'init'

/opt/conda/bin/genv: line 28: genv-help: command not found

@InCogNiTo124
Copy link
Author

I discovered the problem may be connected to the fact that, while building the image, the commands are run as root, but when the built container is started, we switch it up to another user so permissions get all mixed up. Imma look into it in the future.

@razrotenberg
Copy link
Member

Ok thanks for sharing!
I'm closing this issue for now.
We can reopen it any time if you will get this error again 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants