iOS 【Xcode的大坑 启动错误 Loading a plug-in failed The plug-in or one of its prerequisite plug-ins may be】

今天我用爬虫时,把python升级到3.6版。再打开Xcode时提示报错:Loading a plug-in failed The plug-in or one of its prerequisite plug-ins may be missing or damaged and may need to be reinstalled
使用命令行查看错误消息

$/Applications/Xcode.app/Contents/MacOS/Xcode

错误

Library not loaded: /System/Library/Frameworks/Python.framework/Versions/XXX/Python,

说明错误是因为python,不是系统自带版本,缺少了很多第三方lib。

解决方案

获取到系统自带的/Library/Frameworks/Python.framework/Versions/2.7,可以从其它电脑拷贝,替换到原来的位置。

1.修改配置
sudo chown -R root:wheel /System/Library/Frameworks/Python.framework/Versions/2.7
sudo rm /System/Library/Frameworks/Python.framework/Versions/Current
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7 /System/Library/Frameworks/Python.framework/Versions/Current
2.重新链接可执行文件
sudo rm /usr/bin/pydoc
sudo rm /usr/bin/python
sudo rm /usr/bin/pythonw
sudo rm /usr/bin/python-config
3.建立新的链接
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/bin/pydoc2.7 /usr/bin/pydoc
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /usr/bin/python
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7 /usr/bin/pythonw
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7m-config /usr/bin/python-config
注:

最后还可以vi ~/.bash_profile进行编辑

# Setting PATH for Python 2,7

# The orginal version is saved in .bash_profile.pysave
PATH="/System/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

搞定!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值