@krassowski Any suggestion, please?
- How can I change my environment from the
base (root)
environment to newly created environment while using jupyter lab?
You may be interested in GitHub - Anaconda-Platform/nb_conda_kernels: Package for managing conda environment-based kernels inside of Jupyter
As for other questions these look like basic questions about using conda
; I would recommend reading through the conda User Guide (User guide — conda 23.11.1.dev3 documentation). As for Anaconda Navigator - I never used it myself so cannot help here; it is a commercial product and they offer some support - see https://docs.anaconda.com/anaconda/navigator/help-support/.
However, there is some exciting work on JupyterLab Desktop support for virtual environments. Stay tuned.
2 Likes
Thank you @krassowski . However, the nb_conda_kernels does not seem to relate to my question, because it is about kernels, not the environment. The github repo of the library says as follows
This extension enables a Jupyter Notebook or JupyterLab application in one conda environment to access kernels for Python, R, and other languages found in other environments.
What I wanted to do was, when my root environment and another environment are both python kernels, I wanted to change the environment so that each environment can be used for a single purpose. For example, environment A is for data analysis while the environment B is for developing a web-page. Both A and B are using Python kernels.
Even in my example above, do you think the nb_conda_kernels
has something to do with my question?
You can either have JupyterLab installed in a single environment and swap kernels coming from different environments, or have JupyterLab installed in each environment and spawn it from each environment separately, but hot swapping environments with JupyterLab itself is not supported, nor can I see any advantage over the other options available.
1 Like
There is also this interactive approach:
As for *naconda… I can’t really recommend that installation much anymore aside from the very specific case where you are taking a class that requires an exact version of that distribution.
But for the most part, I generally recommend:
- start with Mambaforge
- never do anything in that environment, aside from updating
mamba
and its dependencies (e.g. security updates, ssl cert)
- write and check in a solid
environment.yml
that describes your environment
- include
jupyterlab
and your “object” packages here together
-
don’t install
conda
or mamba
in “sub” environments
- if need be, do include
pip
and any pip
-only leaf packages
- only ever use
mamba env upgrade --file environment.yml --prefix ~/some/path