NaveenBabuE
NaveenBabuE

Reputation: 776

What would be a best practice workflow for creating python environments with Anaconda?

I am trying to set up a standardized workflow for python development for data science. I came across, the popular, Anaconda distribution. But I could not find good documentation on how to setup the workspace.

I created an environment.yml file with the following contents in /workspace/aws-scripts

name: aws-scripts
dependencies:
  - python=3.*
  - boto3

When I created the environment,

conda env create -f environment.yml -p $PWD

the directory structure created is this:

.
├── bin
├── conda-meta
├── environment.yml
├── include
├── lib
├── share
└── ssl

6 directories, 1 file

Should the git ignore file include all the 6 directories that are created?

The default Anaconda prefix is ~/anaconda3/envs. When I changed the prefix for just this workspace, I no longer could list this as an environment using

conda info --envs

Appreciate any help!

Upvotes: 3

Views: 675

Answers (1)

Mike Müller
Mike Müller

Reputation: 85492

Conda environments are used to have isolated setup in terms of Python version and installed libraries. There are not the place to put your own source code. So keep them in the default location ~/anaconda3/envs and do not version control this third party code. Put our own code in the directory /workspace/aws-scripts and use version control there. You can always re-create a conda environment by exporting all settings as a yaml file and using this file to create a new conda environment somewhere else.

Upvotes: 3

Related Questions