MacOS上的Python"dyld:未加载库"; - 错误 [英] Python on MacOS "dyld: Library not loaded" - error
问题描述
我正在尝试运行一个执行少量API调用和Kafka逻辑的python脚本,但出现以下错误:
dyld: Library not loaded: @executable_path/../.Python
I am trying to run a python script that executes few API calls and Kafka logic but getting following error:
dyld: Library not loaded: @executable_path/../.Python
尝试了brew update && brew upgrade
,并且同时使用了Python2和Python3,但仍然遇到相同的错误.
可能是什么原因以及如何解决?
Tried brew update && brew upgrade
and also with both Python2 and Python3 but still getting same error.
What could be the cause and how to fix it?
推荐答案
在brew升级后,我也遇到了这个问题,我用delete virtualenv解决了这个问题.
Hi I got this issue too after brew upgrade, I solved with delete virtualenv
find myvirtualenv -type l -delete
然后重新创建virtualenv
then recreate virtualenv
virtualenv myvirtualenv
参考:
http ://www.jeremycade.com/python/osx/homebrew/2015/03/02/fixing-virtualenv-after-a-python-upgrade/
这篇关于MacOS上的Python"dyld:未加载库"; - 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!