我正在尝试安装AWS Elastic Beanstalk CLI(https://github.com/aws/aws-elastic-beanstalk-cli-setup),但在理解为什么它不起作用时遇到了最大的麻烦(我对这类东西不满意,所以可能很容易。)
我已遵循所有设置说明,但是运行此命令./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer
时得到以下输出和错误:
==============================================
I. Installing Python
==============================================
*************************************************************
1. Determining whether pyenv is already installed and in PATH
*************************************************************
- pyenv was not found in PATH.
*********************************************************
2. Determining whether pyenv should be cloned from GitHub
*********************************************************
- pyenv git repository already cloned to /Users/apple/.pyenv-repository. Won't attempt to clone again.
*******************************************
3. Temporarily export necessary pyenv paths
*******************************************
****************************************************************************
4. Checking whether Python can be downloaded (through curl, wget, or aria2c)
****************************************************************************
************************************************************
5. Installing Python 3.7.2. This step may take a few minutes
************************************************************
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...
python-build: use readline from homebrew
BUILD FAILED (OS X 10.15.2 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/t9/6kkmnhns6g9192p5r2zwmf640000gn/T/python-build.20200204155232.99457
Results logged to /var/folders/t9/6kkmnhns6g9192p5r2zwmf640000gn/T/python-build.20200204155232.99457.log
Last 10 log lines:
File "/private/var/folders/t9/6kkmnhns6g9192p5r2zwmf640000gn/T/python-build.20200204155232.99457/Python-3.7.2/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/private/var/folders/t9/6kkmnhns6g9192p5r2zwmf640000gn/T/python-build.20200204155232.99457/Python-3.7.2/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/private/var/folders/t9/6kkmnhns6g9192p5r2zwmf640000gn/T/python-build.20200204155232.99457/Python-3.7.2/Lib/ensurepip/__init__.py", line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/private/var/folders/t9/6kkmnhns6g9192p5r2zwmf640000gn/T/python-build.20200204155232.99457/Python-3.7.2/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
Exiting due to failure
我的.zshrc
文件中包含以下内容:
CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include"
LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib"
CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix zlib)/include"
所以我不知道发生了什么...
唯一可以解释这一点的是在通过brew安装zlib时得到的以下消息:
==> Caveats
zlib is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
但是然后转到/usr/local/opt
时,可以将zlib
视为符号链接,所以我不明白。。
$ ll /usr/local/opt/
total 0
lrwxr-xr-x 1 apple admin 28B Feb 4 14:43 openssl -> ../Cellar/[email protected]/1.1.1d
lrwxr-xr-x 1 apple admin 28B Feb 4 14:43 [email protected] -> ../Cellar/[email protected]/1.1.1d
lrwxr-xr-x 1 apple admin 21B Feb 4 15:13 zlib -> ../Cellar/zlib/1.2.11
...
您可以尝试安装EB CLI via Homebrew。在我的情况下,这有效,而其他详细方法here没有。