Manage your conda environments from the Jupyter Notebook and JupyterLab
Project description
jupyter_conda
Provides Conda environment and package access extension from within Jupyter Notebook and JupyterLab.
This is a fork of the Anaconda nb_conda package. The decision to fork it came due to apparently dead status of the previous package and a need to integrate it within JupyterLab.
Install
Requirements
- conda >= 4.5
- notebook >= 4.3
- JupyterLab 1.x or 2.x (for the jupyterlab extension only)
Starting from 3.4, this extension will use mamba instead of
conda
if it finds it.
To install in the classical notebook:
conda install -c conda-forge jupyter_conda
To install in the JupyterLab:
conda install -c conda-forge jupyterlab jupyter_conda
jupyter labextension install jupyterlab_conda
Optionally, you could install
jupyterlab-tour
to add a help tour for the conda packages manager.
Classical Jupyter Notebook
Conda tab in the Jupyter file browser
This extensions adds a Conda tab to the Jupyter file browser. Selecting the Conda tab will display:
- A list of the Conda environments that current exist
- The list of Conda packages available in currently configured channels (http://conda.pydata.org/docs/config.html#channel-locations-channels)
- The list of packages installed in the selected environment.
You can click on the name of an environment to select it. That will allow you to:
- see the packages installed in the environment
- install new packages from the available package list
- check for updates on selected (or all) packages
- update selected (or all) packages in the environment.
Conda in the Notebook view
This extension adds a Conda Packages item to the Kernel menu. Selecting this item displays the list of Conda packages in the environment associated with the running kernel, and the list of available packages. You can perform the same actions as in the Conda tab, but only against the current environment.
JupyterLab
This extension add a new entry Conda Packages Manager in the Settings menu.
The first time, it can take quite some time to build the available packages list. But once it is obtained, it will be cached and updated to the background to have a smoother user experience.
Creating New Environments
There are three ways to create an environment:
-
Create a new environment Use the New Environment button at the top of the page, and select
Python 3
, orR
to create a base environment with the corresponding packages. Note that if you want to run a Jupyter python kernel in the new environment, you must also install theipykernel
package in the environment. -
Clone an existing environment Click the clone button next to an environment in the list, and enter the desired name of the new environment.
-
Import an exported environment from a YAML file
Development
conda create -y -n jupyter_conda python jupyterlab~=2.1
conda install -y -n jupyter_conda --file requirements_dev.txt -c conda-forge
source activate jupyter_conda
python setup.py develop
jupyter nbextension install jupyter_conda --py --sys-prefix --symlink
jupyter nbextension enable jupyter_conda --py --sys-prefix
jupyter serverextension enable jupyter_conda --py --sys-prefix
cd labextension
jupyter labextension install .
Changelog
3.4.0
- Features
- Use
mamba
if available. Otherwise useconda
#48 - Move to GitHub workflow (extend coverage to JupyterLab code)
- Use
- Bugs
3.3.1
- Bugs
- Fix export always from history (settings ignored)
3.3.0
- Features
- Add a settings
fromHistory
to export an environment using--from-history
(available for conda >= 4.7.12) #39
- Add a settings
- Bugs
- Documentation
- Start REST API description with Swagger
3.2.0
-
Available package cache file is now writable for everybody to avoid trouble in multi-user context. #25
-
Add update environment from file through REST endpoint PATCH /environments/ #26
-
Switch to newer Python syntax async-await
-
To improve UI reactivity in Jupyterlab:
- Long running task can now be cancelled #32
- The available packages list is used to find updatable package. conda update --dry-run --all is not used any longer. But it is still used if the user request updating all possible packages.
3.1.0
- Request environment list accept now
whitelist
=0 or 1 query arguments. If 1, the environment list is filtered to respectKernelSpecManager.whitelist
. Default is 0, but it could be modified in user settings. - JupyterLab extension
IEnvironmentManager.getPackageManager()
returns always the sameConda.IPackageManager
otherwise signaling package operations would have been meaningless.- Add ability to specify kernel companions; i.e. check that if some packages are installed in a kernel, they must respect a certain version range. Companions can be specified through user settings.
- Small UI tweaks
3.0.0
- Rework the server/client API to be more RESTful and returns 202 status for long operations
- Cache available packages list in temp directory
- Improve greatly the coverage for the server extension
- JupyterLab extension only:
- Allow the user to change the proposed environment when creating one from scratch
- Add signals to handle environnements and packages changes (see
labextension\src\__tests__\services.spec.ts
) - Improve the UI reactivity by using
react-virtualized
for the packages list - Improve the look and feel
- Available packages truncation has been removed.
2.5.1
- Catch SSLError when requesting
channeldata.json
file
2.5.0
- Export in YAML format the environment (import in the older format is still supported).
- Improve responsiveness by loading first installed packages. Then request available one.
- BUG error is prompt when an environment is deleted although everything went well
- Cache some API requests (GET environments, GET channels and GET available packages).
- Available packages are now truncated to 100.
- Use query argument
$skip
to skip N first packages - If the list is longer than 100, a entry
$next
in the response is returned. This
is the request url to use to get the next batch of packages.
- Use query argument
- Report full error message in web browser console to ease debugging.
2.4.2
- BUG environment not shown
- BUG Installing package in develop mode fails if in user home or containing spaces
- Improve error feedback from API to frontend
2.4.1
- BUG
conda search
crashes for conda 4.6
2.4.0
- Add installation of package in development mode (through
pip
)
2.3.x
- Add JupyterLab extension inspired by Anaconda Navigator
- Retrieve conda package description
- Add link to package website (if available)
- Support conda >=4.5
- Make all conda request asynchronously
- Use the automatic installation for Jupyter Notebook extension (see here)
2.2.1
- fix bug in check updates feature
2.2.0
- support conda 4.3
- support notebook security fix introduced in notebook 4.3.1
2.1.0
- fix environment export button
- allow environment names with one letter and validate against "suspicious" characters
2.0.0
- update to new jupyter_conda_kernels naming scheme
- namespace all API calls into
/conda/
1.1.0
- fix usage in root environment
1.0.1
- minor build changes
1.0.0
- Update to notebook 4.2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jupyter_conda-3.4.1.tar.gz
.
File metadata
- Download URL: jupyter_conda-3.4.1.tar.gz
- Upload date:
- Size: 182.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94e0245d5c1bfb8380c124aa364fd4be672393a2e603260f0ed138f023aff334 |
|
MD5 | 673fc6fba49f37dfda5af6be63067c2f |
|
BLAKE2b-256 | 3da5fe999619bfdc858734c4c9274e21bf07f3292ef2c80420d59cc89e168ecf |
File details
Details for the file jupyter_conda-3.4.1-py2.py3-none-any.whl
.
File metadata
- Download URL: jupyter_conda-3.4.1-py2.py3-none-any.whl
- Upload date:
- Size: 58.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0788e504f378264aeda607d54beb835bfaa74d9b76aa27bbcf7f4a75499965ed |
|
MD5 | 6989d4beb2138276b6534a41bf93e039 |
|
BLAKE2b-256 | 47de2a3066f16fee035b2f86293f7184cdd22c9552ee61c8858499b13d73bf6a |