-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
environment.yml vs requirements.txt #1
Comments
@meevans1 I'm not sure exactly what the differences are apart from that the yml file is specific to anaconda. I made the yml to make sure the binder image looks exactly like my local conda env so not sure how a txt would work. Found this https://tdhopper.com/blog/my-python-environment-workflow-with-conda which seems to suggest yml is better? I feel like the build time would decrease if I was able to get a dedicated server! (Maybe one day) Do you have experience with requirement.txt files? |
Yes it does look like environment.yml is better. However, I think a requirements.txt could be quicker, and I think this could be more important in your case. I really wouldn't want a student to lose interest and give up if it's taking too long to load. requirements.txt simply pip installs the packages you want, whereas environment.yml creates a whole environment, which is why I think it takes longer. Additionally, do you really need every single package in your current environment.yml? (more packages = more build time). The minimum you need is the packages you import in your notebooks. Any dependencies are installed if needed automatically. Of course, what you do in the end is totally up to you. Yes I have requirements.txt e.g. https://github.com/atlas-outreach-data-tools/notebooks-collection-opendata/blob/no-root/requirements.txt |
I will look at maybe making requirements.txt files for each activity then (when I'm back in the UK) with only the packages needed for that activity. The yml at the moment has packages needed to run all the activities at once (it is the bare minimum which I test on Linux and is not the same as my bloated Windows env). Maybe I will keep the yml but try not building the binder with it and see what happens using separate requirements.txt files. |
I don't think you'd need to make a separate requirements.txt file for each activity, only one for the whole Code folder. Do you really need all those packages in your yml? For example, I can't find anywhere you "import seaborn" (I could be wrong, I haven't looked through your whole repo). Like I said, you should only need the packages you "import" within notebooks. |
Hmm you're right I seem to have added some plotting libraries that I can remove. Seaborn, bokeh, bqplot... |
Is there a reason you use an environment.yml file? A requirements.txt might build the binder image quicker. Bare in mind I haven't been through your whole repo to check!
The text was updated successfully, but these errors were encountered: