搞砸了我的系统python
我搞砸了我的osx 10.10系统python。 Versions
文件夹现在具有非标准结构,导致出现问题。有没有什么办法可以解决这个问题,而不需要工厂重置?搞砸了我的系统python
$ /System/Library/Frameworks/Python.framework/Versions/bin/python
dyld: Library not loaded: /Library/Frameworks/Python.framework/Versions/2.7/Python
Referenced from: /System/Library/Frameworks/Python.framework/Versions/bin/python
Reason: image not found
Trace/BPT trap: 5
这不是系统Python(内置于OSX的Python),它驻留在/System/Library
中。
/Library
中的一个是事后安装的,使用官方的Python distribution或MacPorts或Homebrew。
要验证您所使用的操作系统提供的蟒蛇,运行
which python
应该
/usr/bin/python
如果不是,请检查您的$ PATH变量。
还要检查你的PYTHONPATH
python -c "import sys;print sys.path"
确保它不包含/System/Library/Frameworks/Python.framework/...
并没有/Library/Frameworks/Python.framework/...
条目。
请注意,默认网站包位于/Library/Python/...
。
一旦你验证了这一点,你可能可以卸载(或重新安装)破损的Python dist(首先做一个pip freeze > requirements.txt
重新安装任何第三方的东西)。
它看起来像我的系统python以某种方式链接到'/ Library' – kilojoules
我猜Capitan的无根已帮助你... – Krumelur
检查我更新的答案。我认为你运行的是错误的Python,而不是系统。 – Krumelur
你是怎么到达那里的? – jonrsharpe
我愚蠢地跟着一篇博客文章告诉我乱七八糟的系统python ...我找不到它了...... – kilojoules