Closed brandon-leapyear closed 3 years ago
Core tap last commit: 4 months ago
This is very likely your issue. Run brew update, brew upgrade and try again.
Nope, still failed
Also, six should not install /usr/local/lib/python3.8 and /usr/local/lib/python3.7. I don't want multiple versions of Python on my machine that I'm not using.
On this point specifically, six
does not install those other versions of python. The six
package on Homebrew does however contain the six
Python package for three different versions of Python (3.{7,8,9}
). If you don't have those older versions of Python installed via Homebrew, the extra Python packages provided here don't do anything.
On the broader issue - is Python already present in the environment? Is six
already installed? Homebrew won't overwrite files that already exist in the installation location. This is the behavior for all formulae in Homebrew, not just six
.
It just so happens that the Homebrew package for six
may conflict with six
provided from pip
, hence the issue you're seeing.
On this point specifically, six does not install those other versions of python. The six package on Homebrew does however contain the six Python package for three different versions of Python (3.{7,8,9}). If you don't have those older versions of Python installed via Homebrew, the extra Python packages provided here don't do anything.
No? If I do rm -rf /usr/local/lib/python3.7
and then brew install six
, I get that directory back.
On the broader issue - is Python already present in the environment? Is six already installed? Homebrew won't overwrite files that already exist in the installation location. This is the behavior for all formulae in Homebrew, not just six.
Yes, that makes sense. Is /usr/local/lib/python3.9
the version of Python that comes with Macs by default? Why is the Homebrew six
package installing there, then? Shouldn't the Homebrew six
package only be installed for the Homebrew python
installation?
No? If I do rm -rf /usr/local/lib/python3.7 and then brew install six, I get that directory back.
There shouldn't be anything in there except stuff pertaining to six
. Keep in mind that python@3.7
looks there for packages, but python@3.7
doesn't actually live there.
Is /usr/local/lib/python3.9 the version of Python that comes with Macs by default?
No (at least for me, on Intel Big Sur).
❯ /usr/bin/python3 --version
Python 3.8.2
My guess is that CircleCI has some other stuff loaded into their environment by default, and your local developer machine may have had pip install six
in the past at some point.
Why is the Homebrew six package installing there, then?
Because the default install prefix for Homebrew on Intel Macs is /usr/local
.
Shouldn't the Homebrew six package only be installed for the Homebrew python installation?
Right now there's no good way to separate Homebrew-managed packages from pip
-managed packages (assuming that pip
is running with Homebrew Python). We're working on improving this.
I see. So I guess in the past, when I installed awscli
manually myself with sudo pip3 install awscli
, it installed /usr/local/lib/python3.9/site-packages/six.py
, and now, six
is still installed there and brew complains. So fixing this is just manually removing six.py
and having brew manage the installation of six
(with any globally pip-installed packages using the brew-managed six
now). Is that right?
That's correct.
Great; I think this can be closed then. Thanks for your help!
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputbrew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
brew install awscli
in CI, to install the AWS CLI. The error was also reproduced on a local developer machine, but I'm not sure how reproducible it is locally.What happened (include all command output)?
I created a brand new Circle CI job running in Mac and ran a single command:
brew install six
What did you expect to happen?
If
six.py
already exists,brew install six
should not error.Also,
six
should not install/usr/local/lib/python3.8
and/usr/local/lib/python3.7
. I don't want multiple versions of Python on my machine that I'm not using.Step-by-step reproduction instructions (by running
brew
commands)