pip19.0.1 list error"AttributeError: _version"
See original GitHub issueEnvironment
- pip version:19.0.1
- Python version:3.7
- OS:MacOS
I update pip from 10.1 to 19.0.1, and I wanna check my python packages, I input “pip list” then two errors occurred. Description
Expected behavior
Exception: Traceback (most recent call last): File “/usr/local/var/pyenv/versions/3.7.0/lib/python3.7/site-packages/pip/_vendor/pkg_resources/init.py”, line 2584, in version return self._version File “/usr/local/var/pyenv/versions/3.7.0/lib/python3.7/site-packages/pip/_vendor/pkg_resources/init.py”, line 2691, in getattr raise AttributeError(attr) AttributeError: _version
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “/usr/local/var/pyenv/versions/3.7.0/lib/python3.7/site-packages/pip/_internal/cli/base_command.py”, line 176, in main status = self.run(options, args) File “/usr/local/var/pyenv/versions/3.7.0/lib/python3.7/site-packages/pip/_internal/commands/list.py”, line 148, in run self.output_package_listing(packages, options) File “/usr/local/var/pyenv/versions/3.7.0/lib/python3.7/site-packages/pip/_internal/commands/list.py”, line 205, in output_package_listing data, header = format_for_columns(packages, options) File “/usr/local/var/pyenv/versions/3.7.0/lib/python3.7/site-packages/pip/_internal/commands/list.py”, line 271, in format_for_columns row = [proj.project_name, proj.version] File “/usr/local/var/pyenv/versions/3.7.0/lib/python3.7/site-packages/pip/_vendor/pkg_resources/init.py”, line 2589, in version raise ValueError(tmpl % self.PKG_INFO, self) ValueError: (“Missing ‘Version:’ header and/or METADATA file”, Unknown [unknown version] (/usr/local/var/pyenv/versions/3.7.0/lib/python3.7/site-packages)) How to Reproduce
- Get package from ‘…’
- Then run ‘…’
- An error occurs.
Output
Paste the output of the steps above, including the commands themselves and
pip's output/traceback etc.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:32 (13 by maintainers)
Top GitHub Comments
@AnonGuy thanks a lot 🙌🏼
-rpcio
with a dash was making the problem…Same for me a package with a dash was the culprit.