[英]How do I fix "dyld: Library not loaded" if I installed the AWS CLI with pip3?
I am trying to deploy a lambda with the AWS CLI.我正在尝试使用 AWS CLI 部署 lambda。 It was working a few months ago but now it's not.
几个月前它可以工作,但现在不行了。
Followed these instructions to install the CLI: https://docs.aws.amazon.com/cli/latest/userguide/install-macos.html按照以下说明安装 CLI: https : //docs.aws.amazon.com/cli/latest/userguide/install-macos.html
Results:结果:
➜ lambda git:(master) ✗ pip3 install awscli --upgrade --user
Requirement already up-to-date: awscli in /Users/justin/Library/Python/3.7/lib/python/site-packages (1.16.310)
[... and so on, it's already installed]
➜ lambda git:(master) ✗ brew uninstall awscli
Error: No such keg: /usr/local/Cellar/awscli
➜ lambda git:(master) ✗ python --version
Python 2.7.17
➜ lambda git:(master) ✗ pip3 --version
pip 19.3.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
➜ lambda git:(master) ✗ python3 --version
Python 3.7.6
➜ lambda git:(master) ✗ aws --version
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /usr/local/aws/bin/python2.7
Reason: image not found
[1] 42316 abort aws --version
Clearly something is borked with my Python install.很明显,我的 Python 安装有问题。 I've been messing around with this for close to 45 minutes now (reinstalling everything mostly and trying some posts like this one ) but I'm no closer to solving it than I was when I started.
我已经搞了将近 45 分钟了(主要是重新安装了所有东西,并尝试了一些像这样的帖子),但我并没有比开始时更接近解决它。
Chip Cullen had the fix: https://chipcullen.com/fixing-bad-interpreter-error-aws-python-3_7/ Chip Cullen 修复了: https : //chipcullen.com/fixing-bad-interpreter-error-aws-python-3_7/
This is because you've probably installed awscli in the past, but more recently upgraded your system Python to version 3.7, not 3.6 (which old versions of awscli worked with).
这是因为您过去可能安装了 awscli,但最近将您的系统 Python 升级到了 3.7 版,而不是 3.6(旧版 awscli 可以使用)。
Short version:精简版:
brew reinstall awscli
brew link --overwrite awscli
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.