How to resolve “dyld: Library not loaded: @executable_path..” error

戏子无情 提交于 2019-12-21 06:47:39

问题


I was trying to check the AWS-CLI version on my MAC OS X. And the below error hit back:

dyld: Library not loaded: @executable_path/../.Python
  Referenced from: /usr/local/aws/bin/python
  Reason: image not found
Abort trap: 6

Any relevant inputs on how to fix this would be highly appreciated.


回答1:


It is a bug with awscli and it might be fixed with the next versions. That's why, a best practices is to upgrade :

brew upgrade awscli



回答2:


You must have messed up with the brew. Try reinstalling it using: brew install awscli (followed by brew link awscli if needed).




回答3:


This error occurs because your virtual environment has broken symlinks. Here is a nice solution. https://gist.github.com/tevino/1a557a0c200d61d4e4fb

Also, here is a similar question: Broken references in Virtualenvs




回答4:


I had similar issue while installing awscli with homebrew on mac. So final approach was "brew uninstall python3" and reinstall awscli again.




回答5:


If you have already python (python --version works. If not install it with brew install python). It works for me:

  1. Uninstall aws

    $ sudo rm -rf /usr/local/aws
    $ sudo rm /usr/local/bin/aws
    
  2. Install it again

    $ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
    $ unzip awscli-bundle.zip
    $ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
    



回答6:


I had it installed through curl, the regular way

$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"

Then it stopped working complaining about not finding python2.7

dyld: Library not loaded: @executable_path/../.Python
  Referenced from: /usr/local/aws/bin/python2.7
  Reason: image not found
Abort trap: 6

so I fixed it by following these steps (make sure you don't do this if you installed it through brew):

$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/aws

Then I installed it using brew:

$ brew upgrade
$ brew install awscli



回答7:


It's possible to trigger this error by having a problem in your virtualenv. For example, I had an existing working virtualenv and ran brew install awscli and it broke my virtualenv with this error. If that's the case, deleting and recreating your virtualenv (the same way you originally created it) should resolve the problem. It did for me.




回答8:


After read the topic, It works for me:

  1. Uninstall aws
$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/aws
  1. Reinstall it again
    $ brew reinstall awscli


来源:https://stackoverflow.com/questions/47629570/how-to-resolve-dyld-library-not-loaded-executable-path-error

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