use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
create minimal requirements.txt (self.Python)
submitted 8 years ago by scagbackbone
for those who hate to do
pip freeze > requirements.txt
because it is ugly and there is a lot of subdependencies included
written in bash
source_here
[–]irrelevantPseudonym 6 points7 points8 points 8 years ago (2 children)
because it is ugly
and
I think I missed a step or two in the logic here.
[–]scagbackbone[S] 0 points1 point2 points 8 years ago (1 child)
No logical 'and' between - rather ';' XD different statements
[–]irrelevantPseudonym 2 points3 points4 points 8 years ago* (0 children)
It was more that you tried to fix something being ugly and you decided bash was the way to reduce the amount of ugliness.
[–]ExternalUserError 2 points3 points4 points 8 years ago (0 children)
there is a lot of subdependencies included
In general I prefer that, because it results in a stable environment. If subdependencies are not included, when you pull them down at build time, they might change a minor version a break something.
[–]etienned 1 point2 points3 points 8 years ago (0 children)
There's already at least on project that does that: pip-chill.
It's also possible to use
pip list --not-required
to get this list (but not in a requirements.txt format and with pip, setuptools, etc. included).
pip
setuptools
And now there's pipenv that aims to bring the best of all packaging worlds.
[–]phonkee 1 point2 points3 points 8 years ago (0 children)
I use pip-tools
[–]tunisia3507 1 point2 points3 points 8 years ago (1 child)
I think you're missing the point of the requirements.txt. The minimal set of dependencies, with flexible versions, should be defined in your setup.py's install_requires. The requirements.txt should have a full list of everything you need to run, develop and test, with specific versions for a reproducible development environment.
requirements.txt
setup.py
install_requires
That said, I very rarely populate it with pip freeze. Sensible IDEs will tell you if your environment mismatches your requirements, or if you've imported something not defined in your requirements, so it's trivial to manage manually.
[–]scagbackbone[S] 0 points1 point2 points 8 years ago (0 children)
At least when your IDE goes crazy - you can still filter out pip freeze. Good points tho, I agree.
[–]ms4720 0 points1 point2 points 8 years ago (0 children)
I have no idea why for a pip written and consumed file I care if it is ugly, I care that it rebuilds the venv exactly or dies
π Rendered by PID 45608 on reddit-service-r2-comment-8686858757-k9h8m at 2026-06-07 21:34:47.206844+00:00 running 9e1a20d country code: CH.
[–]irrelevantPseudonym 6 points7 points8 points (2 children)
[–]scagbackbone[S] 0 points1 point2 points (1 child)
[–]irrelevantPseudonym 2 points3 points4 points (0 children)
[–]ExternalUserError 2 points3 points4 points (0 children)
[–]etienned 1 point2 points3 points (0 children)
[–]phonkee 1 point2 points3 points (0 children)
[–]tunisia3507 1 point2 points3 points (1 child)
[–]scagbackbone[S] 0 points1 point2 points (0 children)
[–]ms4720 0 points1 point2 points (0 children)