Want to use Jupyter Notebook locally

I wanted to work locally on the guided project (with Pandas and NumPy) but I was against some problems. After research, I fix it so I want to share my knowledge to help others.

  1. Create an environment

For that, we can use Anaconda( BEGINNING USERS) or Miniconda ( ADVANCED USERS). I used Miniconda because it’s not heavy like Anaconda and I can manage how I want.

  • Install Miniconda
  • Verify if you can see the version of conda: conda -- version
  • Create an environment: conda create -n my_env
  • After creating it, you can activate by typing: conda activate my_env
  1. Install Jupiter Notebook or JupiterLab

Here make a choice for what you want to use, me personally I use JupyterLab because I prefer his interface. make your choice

  1. Add Virtual Environment to Jupyter Notebook

Jupyter Notebook makes sure that the IPython kernel is available, but you have to manually add a kernel with a different version of Python or a virtual environment.

  • Activate your virtual environment if it’s not: conda activate my_env
  • Install ipykernel which provides the IPython kernel for Jupyter: conda install -c anaconda ipykernel
  • Now you can add your environment to your Jupyter Notebook: python -m ipykernel install --user --name= my_env
  • The last step go on your notebook, change your Kernel and choose your environment.
  1. Installation of packages

Be sure to be on the environment where you want to install the package: conda install name_package
To see the list of packages on an environment: conda list

That was my small contribution, I hope it’ll help someone. Good learning

1 Like

Great initiative @biadboze!

It is always good to share knowledge with others.

1 Like

If anyone thinks anaconda is bloated, can control which packages are installed by default in each new environment: https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#config-add-default-pkgs

Conda is good for making new tensorflows work on your GPU and avoiding dll not found errors, and installing correct pydot so you can plot sklearn decision trees and keras models. However it does not have python3.8 so you can’t have an initial value parameter in functools.accumulate, or everything else in 3.8.