简体   繁体   English

如果我使用 pip3 安装了 AWS CLI,如何修复“dyld:Library not loaded”?

[英]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.

相关问题 pip 或 pip3 install requirements.txt 的问题我应该怎么做才能解决这个错误? - Problems with pip or pip3 install requirements.txt what I should to do to fix this error? 如何在Eclipse中获取PyDev以使用pip3? - How do I get PyDev in eclipse to use pip3? 如何将pip3指向正确的PATH以显示版本 - How do I point pip3 to the correct PATH to display version 如何在 VSC 中使用来自 pip3 的电话号码模块? - How do I use phonenumber module from pip3 in VSC? 物理卸载 Python 3.4 以使 pip3 将“请求”包安装到 Python 3.5,我该如何解决随之而来的混乱? - Physically uninstalled Python 3.4 to make pip3 install “requests” package to Python 3.5, how do I fix the mess that ensued? 用pip3为OS X安装pytorch1.0.1但无法导入,我该怎么办? - installed pytorch1.0.1 for OS X with pip3 but cannot import, what can I do? 如何修复“点子”? - How do I fix "pip"? 如何修复pip:无法导入名称主? (pip已安装且pip3工作正常) - How to fix pip : cannot import name main? (pip is installed and pip3 works fine) 如何修复pip3 mac - how to fix pip3 mac 使用 pip3 安装了 j2cli 和 jinja2 但找不到如何运行 j2cli - Installed j2cli and jinja2 with pip3 but can not find out how to run j2cli
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM