简体   繁体   中英

Python on MacOS "dyld: Library not loaded" - error

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?

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/

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 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM