Skip to content

Instantly share code, notes, and snippets.

@monocongo
Created July 2, 2019 19:48
Show Gist options
  • Save monocongo/13ee335eda8c970bbc28b6acdbfd050e to your computer and use it in GitHub Desktop.
Save monocongo/13ee335eda8c970bbc28b6acdbfd050e to your computer and use it in GitHub Desktop.
Build *conda environment, save requirements.txt and environment.yml

Create and activate a new conda environment:

$ conda create -n myenv python=3 --yes
$ conda activate myenv

Add the conda-forge channel into the conda configuration:

$ conda config --add channels conda-forge

Add packages into the environment using both conda and pip:

$ pip install imutils
$ pip install wget
$ conda install sqlalchemy
$ pip install sqlalchemy_utils
$ conda install tensorflow-gpu
$ pip install keras-retinanet
$ conda install scikit-learn

Save the environment's requirements to requirements.txt and environment.yml:

$ pip freeze > requirements.txt
$ conda env export | grep -v "^prefix: " > environment.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment