【发布时间】:2018-11-02 13:45:10
【问题描述】:
我已经安装了 python 3.6.5(使用 brew),当我在 shell 中执行 python 命令时,总是出现 python 2.7。
我已经在other post 中执行了这些命令,但没有任何效果:
Remove the third-party Python 2.7 framework
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
Remove the Python 2.7 applications directory
sudo rm -rf "/Applications/Python 2.7"
Remove the symbolic links in /usr/local/bin that point to this Python version see ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' and then run the following command to remove all the links:
cd /usr/local/bin/
ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' | awk '{print $9}' | tr -d @ | xargs rm
【问题讨论】:
-
试试
python3?