Skip to content

Latest commit

 

History

History
40 lines (23 loc) · 1.67 KB

File metadata and controls

40 lines (23 loc) · 1.67 KB

How to create a conda virtual environment

Install miniconda or anaconda (both won't work in the same computer)

Full instructions: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands

In a terminal, run the following replacing env_name to something meaningful for this project (I recommend short names because you will be typing it a lot):

conda create -y -n env_name python=3.11 ipywidgets

To use:

conda activate env_name # activate each time you start a new terminal

conda install -y plotly # install another package

pip install another_package_name yet_another_package_name # install another package using pip if not available on conda

You can also make a template and copy it as you create other projects

conda create -n template python=3.9 pandas numpy scikit-learn seaborn matplotlib jupyterlab

conda create --name project1_name --clone template

conda create --name project2_name --clone template

Other commands:

  • INFO: conda info --envs
  • SIZE: du -h -s $(conda info --base)/envs/*
  • REMOVE: conda remove --name env_name --all

Changing Python interpreter in Spyder to your virtual environment

https://docs.spyder-ide.org/current/faq.html#using-existing-environment

Changing Python interpreter in PyCharm to your virtual environment

Preferences > Python Interpreter > Virtual Env > Existing + Make available to all projects