I am running into an error attempting to run the ElasticBeanstalk CLI tools on Mac OSX. I have been troubleshooting path issues and hope someone can shed some light. Here is my set up.
I am running Mac OS X El Capital 10.11.6, and I have manually installed Python 3.4 (via the download installer on python.org). I can see that it is installed correctly in /Library/Frameworks/Python.frameworks/Versions
. Commands beginning with python3
work as expected. I have also installed the the AWS ElasticBeanstalk CLI tools by running sudo pip3 install --upgrade awsebcli
and can confirm it is located in the /Users/myuser/Library/Python/3.4/lib/python/site-packages/
directory.
I have experimented with modifying my ~/.bash_profile
, as well as removing it. When I run echo $PATH
, here is my output:
/Users/myuser/Library/Python/3.4/lib/python/site-packages/ebcli/:
/Library/Frameworks/Python.framework/Versions/3.4/lib/python/site-packages:
/Library/Frameworks/Python.framework/Versions/3.4/bin:
/Users/myuser/.rvm/gems/ruby-2.2.4/bin:
/Users/myuser/.rvm/gems/ruby-2.2.4@global/bin:
/Users/myuser/.rvm/rubies/ruby-2.2.4/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/opt/X11/bin:
/usr/local/git/bin:
/Users/myuser/.rvm/bin
Here is my ~/.bash_profile
# Load the default .profile
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile"
# Load RVM into a shell session *as a function*
#[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
# Setting PATH for Python 3.4 site packages
PATH="/Library/Frameworks/Python.framework/Versions/3.4/lib/python/site-packages:${PATH}"
PATH="/Users/myuser/Library/Python/3.4/lib/python/site-packages/ebcli/:${PATH}"
export PATH
The easiest and recommended way to install the EB CLI is to use the EB CLI setup scripts available on GitHub. Use the scripts to install the EB CLI on Linux, macOS, or Windows. The scripts install the EB CLI and its dependencies, including Python and pip . The scripts also create a virtual environment for the EB CLI.
The EB CLI is a command line interface for AWS Elastic Beanstalk that provides interactive commands that simplify creating, updating and monitoring environments from a local repository. Use the EB CLI as part of your everyday development and testing cycle as an alternative to the Elastic Beanstalk console.
To use this command, SSH must be installed on your local machine and available from the command line. Private key files must be located in a folder named . ssh under your user directory, and the EC2 instances in your environment must have public IP addresses. If the root directory contains a platform.
After a lot more trial and error, I finally got this working. Here are the steps I took.
~/.bash_profile
.Added the following to my ~/.bash_profile
.
# Setting the path for Python 3.4 PATH="/Library/Frameworks/Python.framework/Versions/3.4:${PATH}" export PATH
Opened a new terminal window. (Can also run source ~/.bash_profile
).
Ran eb --version
and got the following output:
EB CLI 3.9.0 (Python 3.4.4)
I realize it's uncool to post one's own answer, but hopefully my trial and error will be helpful to someone else with messed up paths.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With