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 broken after upgrade to 20.3 #9179

Closed
cbrnr opened this issue Nov 30, 2020 · 4 comments
Closed

pip broken after upgrade to 20.3 #9179

cbrnr opened this issue Nov 30, 2020 · 4 comments
Labels
type: support User Support

Comments

@cbrnr
Copy link

cbrnr commented Nov 30, 2020

Environment

  • pip version: 20.3
  • Python version: 3.9
  • OS: macOS Big Sur

Description
When running pip, I get the following errors:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pip._vendor.pkg_resources.VersionConflict: (pip 20.3 (/usr/local/lib/python3.9/site-packages), Requirement.parse('pip==20.2.4'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/opt/[email protected]/libexec/bin/pip", line 33, in <module>
    sys.exit(load_entry_point('pip==20.2.4', 'console_scripts', 'pip3')())
  File "/usr/local/opt/[email protected]/libexec/bin/pip", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/local/Cellar/[email protected]/3.9.0_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/local/Cellar/[email protected]/3.9.0_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/main.py", line 10, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
    from pip._internal.cli import cmdoptions
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/cmdoptions.py", line 25, in <module>
    from pip._internal.cli.progress_bars import BAR_TYPES
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/progress_bars.py", line 12, in <module>
    from pip._internal.utils.logging import get_indentation
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/utils/logging.py", line 18, in <module>
    from pip._internal.utils.misc import ensure_dir
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/utils/misc.py", line 21, in <module>
    from pip._vendor import pkg_resources
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3252, in <module>
    def _initialize_master_working_set():
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3235, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3264, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pip._vendor.pkg_resources.DistributionNotFound: The 'pip==20.2.4' distribution was not found and is required by the application
@pradyunsg
Copy link
Member

Thanks for filing an issue! :)

  1. How did you install Python?
  2. How did you install pip?
  3. How did you upgrade pip?

@cbrnr
Copy link
Author

cbrnr commented Nov 30, 2020

  1. brew install [email protected]
  2. pip came pre-installed with Homebrew Python
  3. pip install -U pip (worked the first time to 20.2.4, but broke now when updating to 20.3)

@pradyunsg pradyunsg added the type: support User Support label Nov 30, 2020
@pradyunsg
Copy link
Member

pradyunsg commented Nov 30, 2020

Thanks!

That looks like Homebrew/homebrew-core#43867 happening again. Sadly, there's nothing actionable here that pip's maintainers can do in this repository, so I'm going to go ahead and close this issue.

It seems to me that this happens every pip release (#6399 (comment)) -- I'd be happy to work with Homebrew's devs to figure out how to prevent these breakages in the future. Please feel free to file an issue with them (if there isn't one already) and @-mention me in it. :)

@cbrnr
Copy link
Author

cbrnr commented Nov 30, 2020

Thank you @pradyunsg! I don't really know what's going on there but I guess the best solution is to just remove /usr/local/opt/[email protected]/libexec/bin from PATH. This folder contains symlinks python, pip, ... pointing to python3, pip3, which I added to my PATH because I don't need Python 2 stuff at all. I will just alias pip to pip3 to prevent such problems.

Thanks again for your quick response!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: support User Support
Projects
None yet
Development

No branches or pull requests

2 participants