Skip to content

Latest commit

 

History

History
executable file
·
80 lines (75 loc) · 1.68 KB

File metadata and controls

executable file
·
80 lines (75 loc) · 1.68 KB

Conda Virtual Env cheat sheet

Conda virtual env


  • Find available conda envs

     conda env list
  • Create a conda virtual env using path prefix (all packages get installed inside the venv dir)

     conda create --prefix /path/to/venv/destination
  • Create a conda virtual env using a name (gets installd under the default conda_home_dir/envs)

     conda env create --file environment.yml
     conda create --name venvname
  • Removing a conda venv

     conda remove --name venvname
     conda remove --prefix /path/to/venv/destination

Conda package management


  • Conda get list of packages in current environment
     conda list -n venvname
     conda list --prefix /path/to/venv/destination
  • Conda export a list of all packages currently installed in venv
     conda env export > environment.yml
  • Conda export a list of packages you explicitly asked for
     conda env export --from-history > environment.yml
  • Conda install packages
    • current active environment
       conda install numpy
    • specific environment
       conda install --name venvname
       conda install --prefix /path/to/to/venv/destination
    • install specific version
       conda install scipy=0.15.0
  • Conda remove packages
     conda remove --name venvname scipy
     conda remove --prefix /path/to/venv/destination scipy
  • Conda update packages
     conda update scipy

Conda meta


  • Conda shorten the venvname prompt
     conda config --set env_prompt '({name})'