MacOS上的Python“dyld:Library not loaded” - 错误

时间:2018-03-06 13:50:44

标签: python macos installation shared-libraries

我正在尝试运行一个执行少量API调用和Kafka逻辑的python脚本,但却出现以下错误:
public valueMapper = (key) => { let selection = this.enumeration.find(e => e.key === key); if (selection) return selection.value; };

尝试dyld: Library not loaded: @executable_path/../.Python以及Python2和Python3,但仍然得到相同的错误 可能是什么原因以及如何解决它?

2 个答案:

答案 0 :(得分:3)

嗨我在brew升级后也遇到了这个问题,我用delete virtualenv解决了

find myvirtualenv -type l -delete

然后重新创建virtualenv

virtualenv myvirtualenv

参考:

http://www.jeremycade.com/python/osx/homebrew/2015/03/02/fixing-virtualenv-after-a-python-upgrade/

答案 1 :(得分:0)

The issue is related to hombrew Python installs/upgrade

任何使用pipenv(您应该使用!)的人都可以简单地使用这两个命令-无需激活venv:

rm -rf `pipenv --venv` # remove the broken venv
pipenv install --dev   # reinstall the venv from pipfile