Python on MacOS “dyld: Library not loaded” - error

情到浓时终转凉″ 提交于 2019-12-24 04:26:30

问题


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

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?


回答1:


Hi I got this issue too after brew upgrade, I solved with delete virtualenv

find myvirtualenv -type l -delete

then recreate virtualenv

virtualenv myvirtualenv

Reference:

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




回答2:


The issue is related to hombrew Python installs/upgrade.

Anyone who is using pipenv (and you should!) can simply use these two commands — without having the venv activated:

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


来源:https://stackoverflow.com/questions/49132419/python-on-macos-dyld-library-not-loaded-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!