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 still doesn't work after a fresh install using the MacOS installer #127193

Closed
SephReed opened this issue Nov 23, 2024 · 4 comments
Closed

pip still doesn't work after a fresh install using the MacOS installer #127193

SephReed opened this issue Nov 23, 2024 · 4 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@SephReed
Copy link

SephReed commented Nov 23, 2024

Bug report

Bug description:

Is there someway you can make it so that running the installer checks for whatever issue this is and tries to correct it?

Ideally, I should be able to install python, open a terminal, type pip, and have it work.

seph-play@MacBook-Pro Downloads % pip
Traceback (most recent call last):
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 568, in _build_master
    ws.require(__requires__)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 886, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 777, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 24.3.1 (/Users/seph-play/Library/Python/3.9/lib/python/site-packages), Requirement.parse('pip==19.0.3'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3243, in <module>
    def _initialize_master_working_set():
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
    f(*args, **kwargs)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 570, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 583, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 772, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==19.0.3' distribution was not found and is required by the application

CPython versions tested on:

3.14

Operating systems tested on:

macOS

@SephReed SephReed added the type-bug An unexpected behavior, bug, or error label Nov 23, 2024
@SephReed
Copy link
Author

oh yeah. pip3

please, if you ever do this again, leave a couple error warnings around or something

@elite-koder
Copy link

Hey @SephReed, Quick Question
Was it pip command wasn't working But pip3 was working ?

@ned-deily
Copy link
Member

The problem here is that the pip command you entered is invoking the old python3.9 that Apple includes as part of Xcode; note the file name in the traceback. And that seems to be because there is a pip in your /usr/local/bin directory. Neither the current python.org installers nor Apple's python3.9 in Xcode install that link. It may be left over from some older installation. A safer way to invoke the desired pip would be to use:

python3.14 -m pip install ...

@hugovk
Copy link
Member

hugovk commented Nov 23, 2024

Here's a longer explanation:

https://snarky.ca/why-you-should-use-python-m-pip/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants