测试人社区

python卸载3.7重装3.8后,报错:dyld: Library not loaded

问题一:
系统:os
问题描述:python很早之前安装了3.7,卸载后重新安装了3.8
终端输入python报错,报错信息如下
dyld: Library not loaded: /Library/Frameworks/Python.framework/Versions/3.8.3/python
Referenced from: /usr/local/bin/python
Reason: image not found
Abort trap: 6

卸载过程:
1、删除3.7的框架
sudo rm -rf /Library/Frameworks/Python.framework/Versions/3.7
2、 删除Python 3.7 应用目录
sudo rm -rf Python\ 3.7
3、 删除/usr/local/bin 目录下指向的Python3.7 的连接
$ cd /usr/local/bin/
$ ls -l /usr/local/bin
$ rm Python3.7

重新安装:
1、官网下载包直接安装
2、输入python报错
dyld: Library not loaded: /Library/Frameworks/Python.framework/Versions/3.7/python
Referenced from: /usr/local/bin/python
Reason: image not found
Abort trap: 6
3、修改了版本的路径
install_name_tool -change /Library/Frameworks/Python.framework/Versions/3.7/Python /Library/Frameworks/Python.framework/Versions/3.8.3/Pytho /usr/local/bin/python
4、还是报错:
dyld: Library not loaded: /Library/Frameworks/Python.framework/Versions/3.8.3/python
Referenced from: /usr/local/bin/python
Reason: image not found
Abort trap: 6

问题二:
系统:os
问题描述:安装homebrew成功后,输入brew ,提示:-bash: brew: command not found
查看了下/usr/local/bin/下,没有对应的brew命令


请先注意下提问的格式哦