3

I am on MacOS. I am following AWS' instruction to install Elastic Beanstalk CLI,

I firstly cloned the git repo of the CLI via command :

git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git

I secondly installed the dependent tools with command brew install zlib openssl readline,

my terminal tells me: enter image description here

Basically it tells me that all those tools have already been installed and up-to-date.

From the linked instruction, in section

2.3. Troubleshooting

The MacOS part, it also suggests a command to tell Python installer where to find those tools, so I follow that instruction and run command:

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"

After that, I also follow the instruction to run brew info to get the latest environment variable export suggestions. e.g. brew info zlib, brew info openssl & brew info readline , and run the export command for each of them respectively.

Finally, I run the command to install the Elastic Beanstalks CLI by:

./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer

But I always get the following error:

BUILD FAILED (OS X 10.15.3 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/jt/ltbk7lgd3k9d_ndl4wncv0z07_g9f8/T/python-build.20200807170051.69471
Results logged to /var/folders/jt/ltbk7lgd3k9d_ndl4wncv0z07_g9f8/T/python-build.20200807170051.69471.log

Last 10 log lines:
  File "/private/var/folders/jt/ltbk7lgd3k9d_ndl4wncv0z07_g9f8/T/python-build.20200807170051.69471/Python-3.7.2/Lib/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "/private/var/folders/jt/ltbk7lgd3k9d_ndl4wncv0z07_g9f8/T/python-build.20200807170051.69471/Python-3.7.2/Lib/ensurepip/__init__.py", line 204, in _main
    default_pip=args.default_pip,
  File "/private/var/folders/jt/ltbk7lgd3k9d_ndl4wncv0z07_g9f8/T/python-build.20200807170051.69471/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/jt/ltbk7lgd3k9d_ndl4wncv0z07_g9f8/T/python-build.20200807170051.69471/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

Why it complains about zlib still even I did everything like the instruction said? How to correctly install the EB CLI ?

Leem.fin
  • 40,781
  • 83
  • 202
  • 354

1 Answers1

3

The Prerequisites section says that you should use Xcode on Mac to install zlib:

Xcode openssl zlib readline

Your description does not mention meeting the Prerequisites required for EBCLI:

Python, which the EBCLI Installer depends on, requires the following prerequisites for each operating system.

Therefore, it its possible that you haven't used Xcode to install required dependencies.

Marcin
  • 215,873
  • 14
  • 235
  • 294
  • How to get rid of "Xcode command not found" error in terminal though I have installed Xcode? – Leem.fin Aug 10 '20 at 08:12
  • @Leem.fin Hi. Not sure. Maybe it was installed incorrectly? Maybe there are some specific steps which you need to take to install, or make it available in the command line for your Mac? – Marcin Aug 10 '20 at 08:15
  • @Leem.fin I checked the issues on github for EBCLI. I found [this](https://github.com/aws/aws-elastic-beanstalk-cli-setup/issues/76) which seems exactly same as your issue. They also provide a solution there involving `brew install pyenv pyenv install 3.7.2`. Have you tried that? – Marcin Aug 10 '20 at 08:58
  • When running `brew install pyenv` get error `Error: Permission denied @ apply2files - /usr/local/lib/node_modules/expo-cli/node_modules/extglob/lib/.DS_Store` – Leem.fin Aug 10 '20 at 09:06
  • @Leem.fin Maybe have to install it as a root with `sudo`? – Marcin Aug 10 '20 at 09:07
  • Homebrew rejects installing as root because it is extremely dangerous. – Leem.fin Aug 10 '20 at 09:11
  • What about running `brew cleanup` or `brew cleanup -d -v` as shown [here](https://github.com/Homebrew/homebrew-core/issues/45009#issue-503992676) and then re-trying to install pyenv as originally attempted? – Marcin Aug 10 '20 at 09:14
  • What does the `-d -v` do? I don't want to mess up other things. – Leem.fin Aug 10 '20 at 09:30
  • @Leem.fin This [github issue](https://github.com/Homebrew/homebrew-core/issues/45009) has many possible solutions regarding issue with `Permission denied @ apply2files`. – Marcin Aug 10 '20 at 13:39