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

Different behavior when adding virtual environment #14422

Open
efakinpelu opened this issue Apr 28, 2024 · 0 comments
Open

Different behavior when adding virtual environment #14422

efakinpelu opened this issue Apr 28, 2024 · 0 comments

Comments

@efakinpelu
Copy link

efakinpelu commented Apr 28, 2024

I tried addding a conda environment following this steps

  1. conda create -n virtual_env
  2. conda activate virtual_env
  3. conda install pip
  4. pip install ipykernel

With
5. ipython -m ipykernel install --user --prefix VIRTUAL_ENV_DIR --name virtual_env --display-name VIRTUAL_ENV

I got Value Error: Can't use prefix and user

With
6. ipython -m ipykernel install --prefix VIRTUAL_ENV_DIR --name virtual_env --diplay-name VIRTUAL_ENV

The virtual environment is installed in the specified --prefix directory
VIRTUAL_ENV is not listed in the kernel list on jupyter notebook

With
7. ipython -m ipykernel install --user --name virtual_env --display-name VIRTUAL_ENV

Virtual environment installs in ~/.local/share directory
VIRTUAL_ENV is listed in the kernel list on jupyter notebook

Now though the Virtual Environment is listed and could be selected in the Jupyter Lab Launcher, the environment variables in the virtual environment goes to defaults.

For instance $CONDA_PREFIX remains /opt/conda in all Notebook instances (Virtual Environment or Default Environment)

Is this the normal way the software is expected to behave?

How do I make the virtual_env visible in the jupyter kernel space and usable installed in the preferred directory?

The instance is ruuning on Google JupyterLab User Managed Notebook

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

1 participant