Как переустановить python@2 из Homebrew?Python

Программы на Python
Гость
Как переустановить python@2 из Homebrew?

Сообщение Гость »


У меня были проблемы с openssl и python@2 с Brew, которые описаны здесь (нерешенные). Документированный способ переустановки Python и openssl не работал, поэтому я решил удалить и переустановить Python.
Проблема в том, что когда вы пытаетесь установить Python 2 с помощью Brew, вы получаете это сообщение:

Код: Выделить всё

brew install python@2
Error: No available formula with the name "python@2"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow

python@2 was deleted from homebrew/core in commit 028f11f9e:
python@2: delete (https://github.com/Homebrew/homebrew-core/issues/49796)
EOL 1 January 2020.
We gave it 1 month more to live so that people had time to migrate.
All in all, developers had 11 years to do their migration.
You can use the `brew extract` command and maintain python@2 in your own
tap if necessary:
https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap

To show the formula before removal run:
git -C "$(brew --repo homebrew/core)" show 028f11f9e^:Formula/python@2.rb

If you still use this formula consider creating your own tap:
https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap
Unfortunately I still have a number of brew formulas that depend on Brew's python@2. Those include ,

Код: Выделить всё

letsencrypt
, pr

Код: Выделить всё

sshuttle
for example

Код: Выделить всё

aws
zsh: /usr/local/bin/aws: bad interpreter: /usr/local/opt/python@2/bin/python2.7: no such file or directory
I don't know how to use this

Код: Выделить всё

brew extract
command they documented to reinstall Python@2. It needs a formula and a tap. I imagine the formula would be

Код: Выделить всё

python@2
. I'm not sure what the tap would need to be.
Additionally reinstalling the taps such as or

Код: Выделить всё

letsencrypt
is not working very well either.
After reinstalling (

Код: Выделить всё

brew reinstall awscli
), running aws commands still gives errors.

Код: Выделить всё

aws
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
if x is 0 or x is 1:
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
if x is 0 or x is 1:
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif y is 0 or y is 1:
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif y is 0 or y is 1:
/usr/local/Cellar/awscli/2.0.0/libexec/lib/python3.8/site-packages/jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="?
if original_result is 0:
usage: aws [options]   [ ...] [parameters]
To see help text, you can run:

aws help
aws  help
aws   help
aws: error: the following arguments are required: command


Источник: https://stackoverflow.com/questions/602 ... m-homebrew

Вернуться в «Python»