Conda Basics

It is recommended to create a new environment for each project and leave the base environment untouched.

In the following, we assume the environment name is cs101.

See Miniforge for more information.

For Linux and macOS:

curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh
conda config --set auto_activate_base false

Add the following lines to settings.json:

"python.condaPath": "~/miniforge/condabin/conda",
"python.defaultInterpreterPath": "~/miniforge/envs/cs101/bin/python",
conda create -n cs101
conda activate cs101
conda create -n cs101 \
pytorch torchvision torchaudio \
numpy matplotlib scipy \
pandas openpyxl seaborn \
scikit-image opencv \
sympy \
shapely rasterio \
colour-science tqdm \
jupyterlab jupytext \
ipykernel ipympl ipywidgets \
spyder \
pytest \
black isort flake8 \
natsort \
-c pytorch -c conda-forge
python -m pip install <package_name>
# JAX Metal, experimental support for Apple Silicon
python -m pip install jax-metal
pip install -e .

In this way, the package will be installed in the current environment and the changes will be reflected immediately.

conda deactivate
conda env list
conda remove -n cs101 --all