卸载以前的版本后,我要重新安装 Python 3.8 - python 2.7.16
所以我在终端上使用了这些命令
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
sudo rm -rf "/Applications/Python 2.7"
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7'
cd /usr/local/bin/
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | tr -d @ | xargs rm
Run Code Online (Sandbox Code Playgroud)
但是当我在完成这些命令后输入“python --version”时,我仍然可以看到“Python 2.7.16”。
我仍然保留它并键入sudo pip install django==3.0.1以安装 django。但我可以看到这个错误
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future …Run Code Online (Sandbox Code Playgroud)