ECMWFCode4Earth / CW4Floods

Main repository for challenge 31/2022: Flood forecasting: the power of citizen science
1 stars 1 forks source link

Create the Python Environment (CW4) and the package structure #1

Closed melioristic closed 2 years ago

melioristic commented 2 years ago

I created the conda environment and installed the packages using the pip command. Is there some way to create the environment file that includes the packages installed through the pip command? We need to look at some of the most reproducible ways to create the environment. @colonesej Do you have some suggestions on this?

colonesej commented 2 years ago

Hi Mohit, You've created a conda environment and installed packages using pip!?

To export the requirements.txt file you use (with the environment activated)

pip freeze > requirements.txt

From past experience and especially with ML packages like pytorch and keras, I would recommend that stick with just conda packages from conda-forge. So , I would recreate the environment and install packages with (again with the environment activated)

conda install -c conda-forge numpy pytorch (...)

Then to export the environment to a file you use

conda env export > environment.yaml

A useful page is

https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#sharing-an-environment

Hope this helps

Juan

Em sáb., 14 de mai. de 2022 18:47, Mohit Anand @.***> escreveu:

I created the conda environment and installed the packages using the pip command. Is there some way to create the environment file that includes the packages installed through the pip command? We need to look at some of the most reproducible ways to create the environment. @colonesej https://github.com/colonesej Do you have some suggestions on this?

— Reply to this email directly, view it on GitHub https://github.com/esowc/CW4Floods/issues/1#issuecomment-1126783864, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALK7JOGAEVLQQENKEJ7VQOTVJ7RLHANCNFSM5V3VYP2A . You are receiving this because you were mentioned.Message ID: @.***>

melioristic commented 2 years ago

So I did create the new environment added everything through conda-forge except xarray, which was installed using conda install -c anaconda xarray Fixed through the commit. https://github.com/esowc/CW4Floods/commit/8cb0df6ed258f28bfdcb9af8967aef899be28263