Skip to content

Automatically activate a conda environment when entering a folder with an environment.yml file

License

Notifications You must be signed in to change notification settings

drorata/conda-auto-env

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

conda-auto-env

(Semi-)Automatically activate a conda environment when entering a folder with an environment.yml file.

If the environment doesn't exist, conda-auto-env creates it and activates it for you.

This functionality was inspired by conda auto activate, virtualenv auto activate and autoenv.

Install

To install add this line to your .bashrc or .bash-profile:

source /path/to/conda_auto_env.sh

If you also want this script to be ran automatically, whenever you enter a directory add also the following:

export PROMPT_COMMAND="conda_auto_env;$PROMPT_COMMAND"

Otherwise, whenever in a directory containing environment.yml, you can execute conda_auto_env.

Remote environments

Alternatively, if you would also like to have support remote anaconda.org environments. Change those instructions to source /path/to/conda_auto_env_remote.sh. To specify a remote environment create an environment-remote.yml file with the name and channel of your environment:

name: pyladies-bokeh
channel: chdoig

About

Automatically activate a conda environment when entering a folder with an environment.yml file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%