-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Make it possible to freeze requirements without installing the packages #747
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
Comments
@matt-hickford the answer is in that question on StackOverflow, in more than one comment/answer. |
generally speaking, if you need different requirements for different environments, then maintain 2 requirements files. if you want to discuss solutions with pip users, feel free to use the pip mailing list. I'm closing, since this is not a bug or feature request. |
Hi Marcus. Sorry, my Stack Overflow question I copied wasn't very clear. My feature request concerns the second part of question - how to write the I've edited the issue description above. If it makes sense, please re-open the issue. Thanks for your patience. |
ok, so a feature request to allow pip to generate an exhaustive requirements file for what pip would install (into a clean environment), given some set of top-level requirements. I can't think of a way to do that now in pip, unless I'm missing something. so I'm leaving the issue open. |
Closing this, I believe that this use case is best solved by pip-compile from pip-tools. |
I'm writing a Python app to deploy on Heroku. Per Heroku's guide, I need to list package requirements in a Pip
requirements.txt
file. They suggest installing the packages locally, then runningpip freeze > requirements.txt
.However, one of the packages I want to use in deployment on Heroku can't be installed locally. It's incompatible with my operating system.
So how do I write a
requirements.txt
including this package suitable for Heroku?The only way I can think of is to write it by hand - but this would be tedious, because the package in question has dependencies of its own. Besides, this defeats the convenience of pip.
If this isn't possible in pip, I think it should be possible. This is a real world use case and Bundler can do it (example below).
When deploying Ruby apps to Heroku, Bundler makes this easy. In my Gemfile I write
The command
bundle install
then writes a frozen version listGemfile.lock
(analogous torequirements.txt
). It doesn't install the packages listed under the 'production' group, but it still freezes a consistent list of versioned packages.Example: Gemfile and Gemfile.lock
The text was updated successfully, but these errors were encountered: