Installing jupytercontribnbextensions ¶. Install the python package ¶. Install javascript and css files ¶. Enabling/Disabling extensions ¶. More complex setups ¶.
-->Although you can configure the environment for your notebook on the project level, you may want to install packages directly within an individual notebook.
Packages installed from the notebook apply only to the current server session. Package installations aren't persisted once the server is shut down.
Python
Packages in Python can be installed using either pip or conda using commands within code cells:
If the command output indicates that the requirement is already satisfied, then Azure Notebooks may include the package by default. The package might also be installed through a project environment setup step.
R
Packages in R can be installed from CRAN or GitHub using the
install.packages
function in a code cell:You can also install prerelease versions and other development packages from GitHub using the devtools library:
F#
Packages in F# can be installed from nuget.org by calling the Paket dependency manager from within code cells. First, load the Paket manager:
Then install packages:
Then load the paket generator:
Open the libray:
Next steps
Active10 months ago
I'm trying to set a good environnement for doing some scientific stuff with python. To do so, I installed Jupyter & miniconda.
Then I want to be able to have different environnement and use them with Jupyter notebooks. So I created two custom envs with conda : py27 and py35.
Then on my notebook I have two kernels
python 2
and python 3
.Inside a notebook, I get the following with the python3 kernel :And this with the python2 kernel :
- How can I set the
sys.executable
to miniconda env for python2 ? - How can I bind a conda env with a notebook kernel ?
- Is doing
source activate py35
has a link withjupyter notebook
?
I think I really missed something.
Thank you everyone.
--- edit
I have multiple jupyter bin :
I have only one kernel here
/usr/local/share/jupyter/kernels/python2
.But inside Jupyter, I have two kernels, python2
and python3
. Where can I find the other one ?I modified
kernel.json
from /usr/local/share/jupyter/kernels/python2
:And then :
So nothing has changed
Thomas Dehaeze
Thomas DehaezeThomas Dehaeze
4 Answers
For Anaconda I suggest you a much easier and proper solution;just give a look at the nb_conda_kernels package.
It allows you to 'manage your conda environment-based kernels inside the Jupyter Notebook'.
Is should be included since Anaconda version 4.1.0, otherwise simply use
Now you should be able to manage all direcly from the Notebook interface.
5agado5agado1,73511 gold badge1515 silver badges2727 bronze badges
Assuming your conda-env is named
cenv
, it is as simple as :If you restart your jupyter notebook/lab you will be able to see the new kernel available.
PS: If you are using virtualenv etc. the above steps hold good.
Nihal SangeethNihal Sangeeth
I found the solution. The setup for the kernels where located here
~/Library/Jupyter/kernels/
.Then I modified the
kernel.json
file and set the right path to python.Now it's working.
Thomas DehaezeThomas Dehaeze
Not sure what else did help, but for me crucial was to install
nb_conda_kernels
in root conda environment. Attempting to install it in specific conda environment did not end up in having Jupyter Notebook be able to use other conda environment other than default one.vedranovedrano