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.1k views
in Technique[技术] by (71.8m points)

homebrew - How are python version 2 and version 3 organized ? I have trouble after bew uninstall python@, I want to reinstate/repair

I did on my mac big sur:

brew uninstall python@2

and then, I tried to check the version of python I have

% 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

Why does Python 2.7.16 still appears and it is not defaulting to python 3.9.1 ? How do I clean this up? And where is Python 2.7.16 located, I cant find it link anywhere. I tried this as well and it doesnt show any version info.

% pyenv versions                                           
* system (set by /Users/axilaris/.pyenv/version)

I am having loads of trouble with Mac OS Big Sur. How do I set the python links correctly and do necessary python cleanups in my mac now ?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
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

...