Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k views
in Technique[技术] by (71.8m points)

homebrew - macos big sur - brew install python@2 doesnt work after uninstall python@2

after I tried to uninstall python 2.7

% brew uninstall python@2     

I cannot reinstall back python 2.7 on my mac (big sur)

% brew install python@2                                    
Error: 
  homebrew-core is a shallow clone.
  homebrew-cask is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
Error: No available formula or cask 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

Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

UPDATE: I notice this as well

% pwd
/Library/Frameworks/Python.framework/Versions
% ls -al
total 0
drwxrwxr-x   6 root  wheel  192 Jan 11 14:18 .
drwxr-xr-x   6 root  wheel  192 Jan 11 14:18 ..
drwxrwxr-x  10 root  admin  320 Nov  8  2017 3.6
drwxrwxr-x  10 root  admin  320 Jan  2 18:24 3.8
drwxrwxr-x  11 root  admin  352 Jan 11 14:18 3.9
lrwxr-xr-x   1 root  wheel    3 Jan 11 14:18 Current -> 3.9
% python -V  
Python 2.7.16
% python3 -V
Python 3.9.1

in another location

% ls -al
total 0
drwxr-xr-x   7 root  wheel  224 Jan  1  2020 .
drwxr-xr-x   5 root  wheel  160 Jan  1  2020 ..
lrwxr-xr-x   1 root  wheel    3 Jan  1  2020 2.3 -> 2.7
lrwxr-xr-x   1 root  wheel    3 Jan  1  2020 2.5 -> 2.7
lrwxr-xr-x   1 root  wheel    3 Jan  1  2020 2.6 -> 2.7
drwxr-xr-x  11 root  wheel  352 Jan  1  2020 2.7
lrwxr-xr-x   1 root  wheel    3 Jan  1  2020 Current -> 2.7
% pwd
/System/Library/Frameworks/Python.framework/Versions

There seems to be 2 installed locations for python in Mac

/Library/Frameworks/Python.framework/Versions
/System/Library/Frameworks/Python.framework/Versions

How can I reinstall python 2.7 or say reinstate it if its unlinked ?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...