You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This resulted in many issues for my brew install of python.
Python installed aliases were replaced with executables and aliases became corrupted and running brew test python resulted in errors:
$ brew test python3
==> Testing python@3.8
==> /usr/local/Cellar/python@3.8/3.8.5/bin/python3.8 -c import sqlite3
==> /usr/local/Cellar/python@3.8/3.8.5/bin/python3.8 -c import tkinter; root = tkinter.Tk()
==> /usr/local/Cellar/python@3.8/3.8.5/bin/python3.8 -c import _gdbm
==> /usr/local/Cellar/python@3.8/3.8.5/bin/python3.8 -c import zlib
==> /usr/local/Cellar/python@3.8/3.8.5/bin/pip3 list --format=columns
Last 15 lines from /Users/admin/Library/Logs/Homebrew/python@3.8/test.05.pip3:
File "/usr/local/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 21, in <module>
from pip._vendor import pkg_resources
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3252, in <module>
def _initialize_master_working_set():
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3235, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.8/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.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pip._vendor.pkg_resources.DistributionNotFound: The 'pip==20.1.1' distribution was not found and is required by the application
Error: python@3.8: failed
An exception occurred within a child process:
BuildError: Failed executing: /usr/local/Cellar/python@3.8/3.8.5/bin/pip3 list --format=columns
/usr/local/Homebrew/Library/Homebrew/formula.rb:2025:in `block in system'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1963:in `open'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1963:in `system'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/python@3.8.rb:344:in `block in <class:PythonAT38>'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1834:in `block (3 levels) in run_test'
/usr/local/Homebrew/Library/Homebrew/utils.rb:492:in `with_env'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1833:in `block (2 levels) in run_test'
/usr/local/Homebrew/Library/Homebrew/formula.rb:893:in `with_logging'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1832:in `block in run_test'
/usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in `block in run'
/usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in `chdir'
/usr/local/Homebrew/Library/Homebrew/mktemp.rb:57:in `run'
/usr/local/Homebrew/Library/Homebrew/formula.rb:2074:in `mktemp'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1826:in `run_test'
/usr/local/Homebrew/Library/Homebrew/test.rb:37:in `block in <main>'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/timeout.rb:33:in `block in catch'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/timeout.rb:33:in `catch'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/timeout.rb:33:in `catch'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/lib/ruby/2.6.0/timeout.rb:108:in `timeout'
/usr/local/Homebrew/Library/Homebrew/test.rb:36:in `<main>'
I thought maybe running brew unlink python && brew link python would help:
Unlinking /usr/local/Cellar/python@3.8/3.8.5... 22 symlinks removed
Linking /usr/local/Cellar/python@3.8/3.8.5...
Error: Could not symlink bin/easy_install-3.8
Target /usr/local/bin/easy_install-3.8
already exists. You may want to remove it:
rm '/usr/local/bin/easy_install-3.8'
To force the link and overwrite all conflicting files:
brew link --overwrite python@3.8
To list all files that would be deleted:
brew link --overwrite --dry-run python@3.8
So I follow directions and run:
brew link --overwrite python@3.8
Linking /usr/local/Cellar/python@3.8/3.8.5... 25 symlinks created
Now the previous executables are replaced with aliases and executables have been installed inside: /usr/local/Cellar/python@3.8/3.8.5/bin
brew test python3 still gives me the same errors as above.
Checking version for pip inside /usr/local/bin
$ /usr/local/bin/pip -V
pip 20.2.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
That’s weird. It seems all of my python aliases are messed up after updating pip and setuptools using the command that Homebrew recommends.
Look at this error when trying to get version of pip3 by path.
$ /usr/local/Cellar/python@3.8/3.8.5/bin/pip3 -V
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 583, in _build_master
ws.require(__requires__)
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 900, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.8/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.2.2 (/usr/local/lib/python3.8/site-packages), Requirement.parse('pip==20.1.1'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/python@3.8/3.8.5/bin/pip3", line 33, in <module>
sys.exit(load_entry_point('pip==20.1.1', 'console_scripts', 'pip3')())
File "/usr/local/Cellar/python@3.8/3.8.5/bin/pip3", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/local/lib/python3.8/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.8/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "/usr/local/lib/python3.8/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.8/site-packages/pip/_internal/utils/logging.py", line 18, in <module>
from pip._internal.utils.misc import ensure_dir
File "/usr/local/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 21, in <module>
from pip._vendor import pkg_resources
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3252, in <module>
def _initialize_master_working_set():
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3235, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.8/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.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pip._vendor.pkg_resources.DistributionNotFound: The 'pip==20.1.1' distribution was not found and is required by the application
To fix the issue I try to go back to the default install without updating pip and setuptools. So, I brew uninstall --ignore-dependencies python && brew install python to test my theory and voila…
Everything is functioning again but I am conerned about the line in the error message:
pip._vendor.pkg_resources.DistributionNotFound: The 'pip==20.1.1' distribution was not found and is required by the application
It seems maybe the requirements aren't being updated when a user upgrades to the latest version of pip and setup tools as suggested on the homebrew python documentation.
Any ideas on how to get around this or if this is a "bug"?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have encountered what I think is a bug but wanted to run it past more experienced users.
After installing python3
brew install python
And running
pip list --outdated
Using the instructions on the Homebrew documentation for python on updating
pip
andsetuptools
I ran the following commands:This resulted in many issues for my brew install of python.
Python installed aliases were replaced with executables and aliases became corrupted and running
brew test python
resulted in errors:I thought maybe running
brew unlink python && brew link python
would help:So I follow directions and run:
Now the previous executables are replaced with aliases and executables have been installed inside:
/usr/local/Cellar/python@3.8/3.8.5/bin
brew test python3
still gives me the same errors as above.Checking version for pip inside /usr/local/bin
That’s weird. It seems all of my python aliases are messed up after updating
pip
andsetuptools
using the command that Homebrew recommends.Look at this error when trying to get version of pip3 by path.
To fix the issue I try to go back to the default install without updating
pip
andsetuptools
. So, Ibrew uninstall --ignore-dependencies python && brew install python
to test my theory and voila…Everything is functioning again but I am conerned about the line in the error message:
It seems maybe the requirements aren't being updated when a user upgrades to the latest version of pip and setup tools as suggested on the homebrew python documentation.
Any ideas on how to get around this or if this is a "bug"?
Beta Was this translation helpful? Give feedback.
All reactions