Create env in project, or create project in env

hi

I am confused about the recommended file structure / project structure. Since the anaconda navigator supports the management of environments, my assumptions was the following:
1: Create new environment with Anaconda
2: Somewhere add my files within this environment

However I read that some people recommend to create a project structure and within this project structure I should create the anaconda environment.
I also asked chatgpt and the recommendation was the same, e.g. using this structure
my_project/
ā”œā”€ā”€ env/ # Anaconda environment
ā”œā”€ā”€ data/ # Data (raw data, intermediate, and final products)
ā”‚ ā”œā”€ā”€ raw/
ā”‚ ā”œā”€ā”€ processed/
ā”œā”€ā”€ notebooks/ # Jupyter Notebooks
ā”œā”€ā”€ scripts/ # Python scripts
ā”œā”€ā”€ src/ # Project source code
ā”œā”€ā”€ tests/ # Test scripts and test data
ā”œā”€ā”€ outputs/ # Results and reports
ā”œā”€ā”€ requirements.txt # Package dependencies (if using pip)
ā”œā”€ā”€ environment.yml # Anaconda environment file
ā””ā”€ā”€ README.md # Project description

If this is the recommended structure, why is there an environment management in a subfolder?

conda environments are a collection of conda (and pip compatible) packages only. Projects are the next level up - where you would include your code and files and data, etc. Anaconda Navigator at this time does not have project integration. Iā€™d recommend learning more about conda-project: GitHub - conda-incubator/conda-project: Tool for encapsulating, running, and reproducing projects with Conda environments
In other words, environment management is in a subfolder, because it only encapsulates which packages (like python, numpy, pandas) are available to your project. It does not cover where your code and your data is or any of the rest.
Hope this helps make it a bit more clear.

1 Like

hi @CrystalS thanks for your feedback! This helps, and I will checkout the link you provided