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 includes "pkg-resources==0.0.0" #4668

Closed
JulienPalard opened this issue Aug 11, 2017 · 8 comments
Closed

pip freeze includes "pkg-resources==0.0.0" #4668

JulienPalard opened this issue Aug 11, 2017 · 8 comments
Labels
auto-locked Outdated issues that have been locked by automation C: freeze 'pip freeze' related project: <downstream> When the cause/effect is related to redistributors

Comments

@JulienPalard
Copy link

  • Pip version: 9.0.1
  • Python version: 3.5.3
  • Operating system: Debian Stretch, 9.1

Description:

Ran pip freeze, got pkg-resources==0.0.0 like in #4022.

What I've run:

$ python3 --version
Python 3.5.3
$ python3 -m venv /tmp/pip-freeze
$ . /tmp/pip-freeze/bin/activate
(pip-freeze) $ python3 -m pip --version
pip 9.0.1 from /tmp/pip-freeze/lib/python3.5/site-packages (python 3.5)
(pip-freeze) $ python3 -m pip freeze
pkg-resources==0.0.0
@JulienPalard
Copy link
Author

JulienPalard commented Aug 11, 2017

He's here, probably a venv issue more than a pip freez issue:

$ python3 -m venv pip-freez
$ ls -lah pip-freez/share/python-wheels/ | grep pkg
-rw-r--r-- 1 julien julien 113K Aug 11 14:59 pkg_resources-0.0.0-py2.py3-none-any.whl

There's other wheels here, still don't know why this one is picked by pip freeze and not the others.

@pfmoore
Copy link
Member

pfmoore commented Aug 11, 2017

This doesn't occur for me on Windows, and as far as I'm aware it's not typical for venvs to have a "share" directory containing wheels. Could this be related to how your OS vendor has packaged python/pip? (Do Debian unbundle pip's dependencies?)

@JulienPalard
Copy link
Author

Looks like so, the Debian packaged ensurepip looks to have:

_PROJECTS = [
    "setuptools",
    "pip",
    "pkg_resources",
]

While the cpython 3.5 one have:

_PROJECTS = [
    ("setuptools", _SETUPTOOLS_VERSION),
    ("pip", _PIP_VERSION),
]

@pfmoore
Copy link
Member

pfmoore commented Aug 11, 2017

OK, so I guess you'll need to report this to Debian.

@JulienPalard
Copy link
Author

I'm reading: https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1220988.html and I see:

    • When ensurepip is run inside of a venv, it copies all dependent wheels from
  • /usr/share/python-wheels.

So I checked if pkg_resource is copied from /usr/share as said and yes:

$ dpkg -S /usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl
python-pip-whl: /usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl

So I checked python-pip-whl which contains in its README.debian:

pip on Debian is a crazy mess due to upstream's vendorizing of several
packages, which violates both the DFSG and Debian Policy. To resolve this
conflict, we package up these dependencies as PEP 427 wheels, essentially zip
files containing importable pure-Python code and a metadata directory. These
wheels live in separate python--whl binary packages, and are installed
into /usr/share/python-wheels.

@pfmoore
Copy link
Member

pfmoore commented Aug 11, 2017

OK, but not sure why they've created a separate pkg_resources wheel, as normally pkg_resources is part of setuptools. Looks like in doing so, they forgot to special-case that package so it doesn't show up in pip freeze (as there's no way pip can satisfy that requirement in general).

Anyway, there's clearly no pip or virtualenv bug here, it's up to Debian to make sure their "crazy mess" is consistent ;-)

Nevertheless, thanks for reporting it - it's useful to us to know what the distros do, so we can advise others in similar situations to yours.

@JulienPalard
Copy link
Author

@pradyunsg pradyunsg added project: <downstream> When the cause/effect is related to redistributors C: freeze 'pip freeze' related labels Aug 12, 2017
@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label May 11, 2018
@chrahunt
Copy link
Member

It doesn't look like there is anything for pip to do here, so I will close this issue, but please reach out if there is something pending.

@chrahunt chrahunt removed the S: needs triage Issues/PRs that need to be triaged label Aug 10, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Sep 9, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 9, 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 project: <downstream> When the cause/effect is related to redistributors
Projects
None yet
Development

No branches or pull requests

4 participants