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

时光总嘲笑我的痴心妄想 提交于 2021-02-11 04:29:35

问题


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 ?

来源:https://stackoverflow.com/questions/65662360/how-are-python-version-2-and-version-3-organized-i-have-trouble-after-brew-uni

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!