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

pip3 install -U pip check version raise ValueError Exception #6177

Closed
chenray844 opened this issue Jan 23, 2019 · 9 comments
Closed

pip3 install -U pip check version raise ValueError Exception #6177

chenray844 opened this issue Jan 23, 2019 · 9 comments
Labels
C: check Checking dependency graph for consistency project: setuptools Related to setuptools

Comments

@chenray844
Copy link

chenray844 commented Jan 23, 2019

Environment

  • pip version: 18.1
  • Python version: 3.6.8
  • OS: Mac OS

Description

 pip3 install -U pip
Looking in indexes: https://mirrors.ustc.edu.cn/pypi/web/simple
Collecting pip
  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/60/64/73b729587b6b0d13e690a7c3acd2231ee561e8dd28a58ae1b0409a5a2b20/pip-19.0-py2.py3-none-any.whl (1.4MB)
    100% |████████████████████████████████| 1.4MB 4.2MB/s 
Exception:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip-18.1-py3.6.egg/pip/_vendor/pkg_resources/__init__.py", line 2570, in version
    return self._version
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip-18.1-py3.6.egg/pip/_vendor/pkg_resources/__init__.py", line 2677, in __getattr__
    raise AttributeError(attr)
AttributeError: _version

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip-18.1-py3.6.egg/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip-18.1-py3.6.egg/pip/_internal/commands/install.py", line 349, in run
    self._warn_about_conflicts(to_install)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip-18.1-py3.6.egg/pip/_internal/commands/install.py", line 475, in _warn_about_conflicts
    package_set, _dep_info = check_install_conflicts(to_install)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip-18.1-py3.6.egg/pip/_internal/operations/check.py", line 98, in check_install_conflicts
    package_set = create_package_set_from_installed()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip-18.1-py3.6.egg/pip/_internal/operations/check.py", line 41, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip-18.1-py3.6.egg/pip/_vendor/pkg_resources/__init__.py", line 2575, in version
    raise ValueError(tmpl % self.PKG_INFO, self)
ValueError: ("Missing 'Version:' header and/or METADATA file", Unknown [unknown version] (/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages))
@Manchangdx
Copy link

我也遇到了相同的问题,鼓捣了两小时未果。

@mvolgyi
Copy link

mvolgyi commented Jan 29, 2019

I'm having the same problem! :(

@cjerdonek cjerdonek added the S: needs triage Issues/PRs that need to be triaged label Jan 30, 2019
@miozus
Copy link

miozus commented Jan 31, 2019

I have met this solution for sad 3 days but solved by reinstalling:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

python get-pip.py

Collecting pip
Using cached https://files.pythonhosted.org/packages/46/dc/7fd5df840efb3e56c8b4f768793a237ec4ee59891959d6a215d63f727023/pip-19.0.1-py2.py3-none-any.whl
Collecting wheel
Using cached https://files.pythonhosted.org/packages/ff/47/1dfa4795e24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3-none-any.whl
Installing collected packages: pip, wheel
Found existing installation: pip 18.1
Uninstalling pip-18.1:
Successfully uninstalled pip-18.1
Successfully installed pip-19.0.1 wheel-0.32.3

@mvolgyi
Copy link

mvolgyi commented Jan 31, 2019

I have met this solution for sad 3 days but solved by reinstalling:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

python get-pip.py

Collecting pip
Using cached https://files.pythonhosted.org/packages/46/dc/7fd5df840efb3e56c8b4f768793a237ec4ee59891959d6a215d63f727023/pip-19.0.1-py2.py3-none-any.whl
Collecting wheel
Using cached https://files.pythonhosted.org/packages/ff/47/1dfa4795e24fd6f93d5d58602dd716c3f101cfd5a77cd9acbe519b44a0a9/wheel-0.32.3-py2.py3-none-any.whl
Installing collected packages: pip, wheel
Found existing installation: pip 18.1
Uninstalling pip-18.1:
Successfully uninstalled pip-18.1
Successfully installed pip-19.0.1 wheel-0.32.3

It worked for me too.

Regards!

@chenray844
Copy link
Author

Excuse me, I still have this error following @Aazingmiao advices. But the installed package can work successfully.

pip install -U pip
Looking in indexes: https://mirrors.ustc.edu.cn/pypi/web/simple
Requirement already up-to-date: pip in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (19.0.2)
Error checking for conflicts.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2584, in version
    return self._version
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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 "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 503, in _warn_about_conflicts
    package_set, _dep_info = check_install_conflicts(to_install)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 108, in check_install_conflicts
    package_set, _ = create_package_set_from_installed()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_internal/operations/check.py", line 47, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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] (/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages))

pip version

pip -V
pip 19.0.2 from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip (python 3.6)

@cjerdonek
Copy link
Member

Getting a better error message is the subject of this setuptools issue: pypa/setuptools#1664

@cjerdonek
Copy link
Member

Related to this, I filed a PR on setuptools' tracker to make the error message more informative: pypa/setuptools#1706

pganssle pushed a commit to cjerdonek/setuptools that referenced this issue Mar 31, 2019
Related to pip's github issue pypa/pip#6194.

This has come up in pip's issue tracker (github) multiple times:

  - pypa/pip#6177
  - pypa/pip#6283
  - pypa/pip#6194
pganssle pushed a commit to cjerdonek/setuptools that referenced this issue Apr 3, 2019
Related to pip's github issue pypa/pip#6194.

This has come up in pip's issue tracker (github) multiple times:

  - pypa/pip#6177
  - pypa/pip#6283
  - pypa/pip#6194
@cjerdonek
Copy link
Member

FYI, setuptools just made a release (40.9.0) where the ValueError exception message now includes the path to the specific directory causing the problem: pypa/setuptools#1706 (comment)

@pradyunsg
Copy link
Member

Given the last comment and that there hasn't been any follow up questions, I think this is resolved. :)

@pradyunsg pradyunsg added C: check Checking dependency graph for consistency project: setuptools Related to setuptools labels Jun 30, 2020
@triage-new-issues triage-new-issues bot removed S: needs triage Issues/PRs that need to be triaged labels Jun 30, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: check Checking dependency graph for consistency project: setuptools Related to setuptools
Projects
None yet
Development

No branches or pull requests

6 participants