A small script that creates minimal conda environment files
initialized with name
and python version
.
Useful for running multiple python projects on the same computer.
Includes versions for bash (mac/linux) and powershell (windows).
- Clone this repository and move into the directory
git clone git@github.com:johnhenry/conda-init.git
cd conda-init
-
Run the appropriate installation script
- bash:
bash ./install.sh
- powershell:
pwsh ./install.ps1
or place the appropriate script in your path manually.
Use the installed script to initialize an environment for a new project.
Run the appropriate script inside of a project.
- bash:
conda-init
- powershell:
conda-init.ps1
This initializes an environment.yml
file.
Included as part of source control.
Usage for projects that contain an environment.yml
file
Use environment.yml
with conda to create an environment specific to your project.
conda env create -f environment.yml
Once created, activate the environment before working on a project.
conda activate <environment name>
(Restarting the shell requires reactivating the environment)
Deactivate the current environment:
conda deactivate
(or by closing the terminal window)
List existing conda environments:
conda env list
(An asterisk marks the current environment)
Remove a conda environment:
conda env remove -n <environment name> --all
(Drop the '--all' flag for windows)