Skip to content
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

pip freeze -r requirements.txt strips URLs #452

Closed
adamsb6 opened this issue Feb 7, 2012 · 5 comments
Closed

pip freeze -r requirements.txt strips URLs #452

adamsb6 opened this issue Feb 7, 2012 · 5 comments
Labels
auto-locked Outdated issues that have been locked by automation C: freeze 'pip freeze' related

Comments

@adamsb6
Copy link

adamsb6 commented Feb 7, 2012

This is very similar to issue #43.

When running 'pip freeze -r requirements.txt', the output generated does not contain the package URLs specified in the referenced requirements.txt. For example, if I had a line like this in my requirements.txt:

http://mydomain.com/mypackage.tar.gz#egg=mypackage==1.0

Then the output associated with that line would just be:

mypackage==1.0

Subsequent runs of 'pip install -r requirements.txt' then fail, since mypackage is not in a repository that pip searches.

Ideally, if a user installed a package by referencing a URL, e.g.:

pip install http://mydomain.com/mypackage.tar.gz

Then a simple 'pip freeze' would contain that URL so that future pip runs install from it.

@carljm
Copy link
Contributor

carljm commented Feb 7, 2012

When pip installs a tarball from a specific URL, it currently doesn't record that "source" metadata with the installed package, so the only available metadata is the setup.py version, which is why that is what's reflected in the output of pip freeze.

It would be possible for pip to save the exact source line in a custom metadata file in the egg-info directory, and I think this would be reasonable. Then pip freeze could provide a more accurate representation of how things were originally installed.

Pull request welcome! (I think @dstufft may have also had some interest in working on this.)

@dstufft
Copy link
Member

dstufft commented Feb 7, 2012

Yea i've been planning on storing the exact tarball, the requirements line, probably any other data about what and from where a package was installed from that I can locate. I havn't had time yet but it's something I plan on doing as soon as I can (if someone doesn't beat me).

@qwcode
Copy link
Contributor

qwcode commented Mar 27, 2014

the open PR for this: #507

@ldshi
Copy link

ldshi commented Jun 16, 2016

How this issue still didn't get fixed? The #507 already got closed!

I think this is important: it is not a good manner that when u commit a project u commit all ur dependencies modules, better let the other people can rebuild the environment by just running 'pip install -r requirements.txt', but unfortunately, it will fail because pip strips the source url info.

Every time I need to manually maintain the requirements.txt just because 'pip freeze' will strip the info again and again.

@dstufft
Copy link
Member

dstufft commented Mar 30, 2017

I'm going to close this. Directly referencing an URL like that is sort of fraught with issues, this being one of them. A better answer would be to do something like

-f https://example.com/example-1.0.tar.gz#egg=example-1.0

example==1.0

This should then work correctly.

@dstufft dstufft closed this as completed Mar 30, 2017
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: freeze 'pip freeze' related
Projects
None yet
Development

No branches or pull requests

6 participants