This repository hosts scripts to generate self-contained installations of the EB CLI.
Use the following:
git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.gitOn Bash and Zsh on OS X/Linux:
./aws-elastic-beanstalk-cli-setup/scripts/bundled_installerIn PowerShell or in a Command Prompt window:
.\aws-elastic-beanstalk-cli-setup\scripts\bundled_installer-
Linux
Almost all installation problems experienced by customers on Linux/OS X have been due to missing libraries such as OpenSSL, bzip2, etc.
-
On Ubuntu/Debian, run:
apt-get install \ zlib1g-dev libssl-dev libncurses-dev libffi-dev \ libsqlite3-dev libreadline-dev libbz2-dev -
On Amazon Linux/Fedora, run:
yum install \ zlib-devel openssl-devel ncurses-devel libffi-devel \ sqlite-devel.x86_64 readline-devel.x86_64 bzip2-devel.x86_64
-
-
OS X
Most problems on OS X have been with loading and linking OpenSSL and zlib. The following commands install necessary packages and tell the Python installer where to find them.
brew install zlib openssl readline 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" -
Windows
-
In PowerShell, upon executing
bundled_installer, if you see an error with the message "execution of scripts is disabled on this system", set the execution policy to "RemoteSigned" and then rerunbundled_installer.Set-ExecutionPolicy RemoteSigned
-
On Linux and OS X, the output will contain instructions to add the EB CLI (and Python) executable file to the shell's $PATH variable, if it isn't already in it.
To install the EB CLI, bundled_installer runs ebcli_installer.py. ebcli_installer.py has the following capabilities:
-
To install a specific version of the EB CLI:
python scripts/ebcli_installer.py --version 3.14.13
-
To install the EB CLI with a specific version of Python (the Python version doesn't need to be in
$PATH):python scripts/ebcli_installer.py --python-installation /path/to/some/python/on/your/computer
-
To install the EB CLI from source (Git repository, .tar file, .zip file):
python scripts/ebcli_installer.py --ebcli-source /path/to/awsebcli.zip python scripts/ebcli_installer.py --ebcli-source /path/to/EBCLI/codebase/on/your/computer
-
To install the EB CLI at a specific location, instead of in the standard
.ebcli-virtual-envdirectory in the user's home directory:python scripts/ebcli_installer.py --location /path/to/ebcli/installation/location
Run the following command to view the help text for ebcli_installer.py:
python scripts/ebcli_installer.py --helpYes. If you already have Python installed on your system, after step 2.1., run the following.
On Bash and Zsh:
python aws-elasticbeanstalk-cli-setup/scripts/ebcli_installer.pyIn PowerShell and from the Command Prompt window:
python .\aws-elasticbeanstalk-cli-setup\scripts\ebcli_installer.py4.2. For the experienced Python developer, what's the advantage of this mode of installation instead of regular pip inside a virtualenv?
Even within a virtualenv, a developer might need to install multiple packages whose dependencies are in conflict. For example, at times the AWS CLI and the EB
CLI have used conflicting versions of botocore. One such instance was particularly egregious. When there are
conflicts, users have to manage separate virtualenvs for each of the conflicting packages, or find a combination of the packages without conflicts.
Both these workarounds become unmanageable over time, and as the number of packages that are in conflict increases.
Yes, for these reasons:
- The AWS Elastic Beanstalk team has no control over how
brewoperates. - The
brew install ...mechanism doesn't solve the problem of dependency conflicts, which is a primary goal of this project.
The opinion of the AWS Elastic Beanstalk team is "No".
Aside from the problem described in 4.2., developers new to Python are often confused by the presence of multiple versions of Python and pip executable files on
their system. A common problem that such developers encounter is that when they install eb with one pip executable file (presumably using the sudo
prefix),
no eb-related commands work because the correct set of directories isn't referenced correctly.
Typically, for such developers, use of virtualenv is the correct path forward. However, this becomes yet another hurdle before using eb.
Another common problem is where users install Python and pip in ways that ElasticBeanstalk Documentation doesn't recommend, such as using arbitrary Personal Package Archives
(PPAs) on Ubuntu, or similar unmaintained sources that lack scrutiny.
No. At this time, we don't directly support execution on Bash-like environments on Windows. Use PowerShell or the Command Prompt window to install. You can
add the location of the eb and Python executable files to $PATH .
Yes, but only if you have Bash on your computer. At this time we don't provide specific guidance on how to set $PATH in Fish, however, Fish has detailed documentation for this purpose.
Yes. It's safe to execute bundled_installer even if you already have Python installed. The installer will skip reinstallation.
Yes.
Consider the following two cases:
-
ebcli_installer.pywas previously run, creating.ebcli-virtual-envin the user's home directory (or the user's choice of a directory indicated through the--locationargument). In this case, the EB CLI will overwrite.ebcli-virtual-envand attempt to install the latest version of the EB CLI in thevirtualenvwithin it. -
ebis in$PATH, however, it wasn't installed byebcli_installer.py. In this case, the installer will installebwithin.ebcli-virtual-envin the user's home directory (or the user's choice of a directory indicated through the--locationargument), and prompt the user to prefix/path-to/.ebcli-virtual-env/executablesto$PATH. Until you perform this action, the olderebexecutable file will continue to be referenced when you typeeb.
When executing the Python script, ebcli_installer.py does the following:
- Creates a
virtualenvexclusive to theebinstallation. - Installs
ebinside thatvirtualenv. - In the
<installation-location>/executablesdirectory, it generates:- A
.pywrapper forebon Linux or macOS. .batand.ps1wrappers forebon Windows.
- A
- When complete, you will be prompted to add
<installation-location>/executablesto$PATH, only if the directory is not already in it.
- On macOS or Linux,
bundled_installeruses the extremely popularpyenvproject to install the latest version of Python 3.7. - On Windows, it downloads the MSI installer of the latest Python version from Python's website and silently installs it.
Unfortunately, yes.
Suppose the dependencies of eb, say Dep A and Dep B, are in conflict. Because pip lacks dependency management capabilities, the resulting eb installation might not work.
Yes, however, be aware that Python 2.7 will be deprecated on January 1, 2020. There won't be security updates after that date.
Also, the latest minor version series, Python 3.7, offers significant improvements over the Python 2.7 series. We highly recommend that you use Python 3.7 for testing purposes, even though the Elastic Beanstalk team tests the EB CLI against Python 2.7.
This library is licensed under the Mozilla Public License Version 2.0.
