Name of the kernel and the conda environment are independent from each other, but it might make sense to use a similar name. Jupyter notebook # run jupyter from system by 'apt install jupyter' on debian-based systems Then run jupyter from the system installation or a different conda environment: conda deactivate # this step can be omitted by using a different terminal window than beforeĬonda install jupyter # optional, might be installed already in system e.g. Ipython kernel install -user -name=my-conda-env-kernel # configure Jupyter to use Python kernel Option 2: Create special kernel for the conda environmentĬonda install ipykernel # install Python kernel in new conda env Of the next two options might be preferable, but this one is the simplest one and definitely fine. Install this separately for every environment and include it in every env.yml file. The rest of Jupyter notebook can be considered as editor or viewer and it is not necessary to Include the kernel in the environment, which is the component wrapping Python which runs the code. Different versions of Jupyter can be usedįor different conda environments, but this option might be a bit of overkill. Jupyter will be completely installed in the conda environment. Jupyter notebook # start server + kernel inside my-conda-env In short, there are three options how to use a conda environment and Jupyter: Option 1: Run Jupyter server and kernel inside the conda environmentĭo something like: conda create -n my-conda-env # creates new virtual envĬonda activate my-conda-env # activate environment in terminalĬonda install jupyter # install jupyter + notebook If nb_conda_kernels is used, additional to statically configured kernels, a separate kernel for each conda environment with ipykernel installed will be available in Jupyter notebooks. Kernels are configured by specifying the interpreter and a name and some other parameters (see Jupyter documentation) and configuration can be stored system-wide, for the active environment (or virtualenv) or per user. The kernel can be a different Python installation (in a different conda environment or virtualenv or Python 2 instead of Python 3) or even an interpreter for a different language (e.g. Jupyter runs the user's code in a separate process called kernel. Disclaimer: ATM tested only in Ubuntu and Windows (see comments to this answer).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |