Install Miniconda on WSL2
Install Miniconda on WSL2
This recipe sets up a core Data Science environment in WSL2 using Miniconda as the base.
Steps
-
We assume that you have a working WSL2 distribution
-
Install Miniconda
cd ~ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh chmod +x Miniconda3-latest-Linux-x86_64.sh sh Miniconda3-latest-Linux-x86_64.sh rm Miniconda3-latest-Linux-x86_64.sh -
Update packages
conda update conda conda update --all -
Create an environment with the version of python you want and necessary packages
conda env create --name datasci --python=3.11 conda activate datasci conda install pandas scikit-learn matplotlib jupyter jupyterlab sqlalchemy seaborn pip git ipykernel notebook conda install -c conda-forge jupyter_contrib_nbextensions conda update conda conda update --all -
go to your working directory and export an
environment.ymlcd myproject conda env export > environment.yml -
Setup a virtual Python kernel in the environment
python -m ipykernel install --user --name=datasciTo use that kernel, see Setting up virtual python kernel in environment