I initially installed Elastic Beanstalk (via $ pip install awsebcli) using Python 2. I want to make sure my application will be deployed with Python 3. I tried uninstalling Elastic Beanstalk ($ pip uninstall awsebcli) and reinstalling it, but when I run $ eb -- version I still get EB CLI 3.12.1 (Python 2.7.1).
1 Answer
I know this question is a few months old but I thought I'd add a clarified answer since I just encountered this.
The Problem
I was trying to install the awsebcli with the python2 version of pip.
If you run pip --version it'll tell you:
$ pip --version
pip 18.0 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
The Solution
What you need it to install pip from python3-pip and use the pip3 command.
First of course if you've installed the awsebcli with this pip version you'll want to remove it.
$ pip uninstall awsebcli
Now install the new python3 version of pip:
$ sudo apt-get install python3-pip
This will make the pip3 command available which manages python3 libraries.
$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
Next install the awsebcli with pip3
$ pip3 install awsebcli
Finally check that you've got the right eb version:
$ eb --version
EB CLI 3.14.4 (Python 3.6.5)
2 Comments
which awsebcli (or maybe which eb - it's been a while since I've written this). I suspect you've got it installed in more than one place (i.e. both at the global level and at your user level). If that's the case you need to remove it from the additional location(s) too.
pip2? If yes, doespip2 listshowawsebcliinstalled? If yes, performpip2 uninstall awsebcli. Performeb --versionnow to verify thatawsebcliis gone.