The goal is to install a Python friendly environment on your computer. It works on Linux, Windows and OSX. The base
environment will provide you the minimum to be able to start Jupyter and then we will use different Conda environments with all the necessary packages to do analysis. Those environments will then be available as kernels in Jupyter.
-
Install Anaconda or Miniconda.
- Miniconda is a light version of Anaconda that provide less packages. If you pan to use Conda environments, I would recommend using it.
-
Open a terminal.
-
Activate the
base
Conda environment (also calledroot
):
conda activate base
- Add the conda forge channel to your installation. It provides a wide variety of conda packages not available in the default channel:
conda config --add channels conda-forge
conda config --set channel_priority strict
- Install Jupyter server in your
base
environment:
conda install jupyterlab nodejs nb_conda_kernels
- Create a new environment where you are going to install the packages needed for your analysis. Here we call the envirionment
ws
forworkspace
but you can name it differently:
conda create -n ws python
- Activate your newly created environment:
conda activate ws
- Install the Python kernel and some useful packages in it:
conda install ipykernel numpy scipy matplotlib scikit-image scikit-learn pandas
- Now you can start Jupyter, create a new notebook and select the
ws
kernel.
- To update all the packages in an environment you can run the following:
conda activate ws # or whatever env you want
conda update --all
- If you have a Conda environment file
environment.yml
with a list of packages in it, you can update your environment with:
conda activate ws # or whatever env you want
conda env update -f environment.yml