Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade Python on Mac from 2.7 to 3.6 (or newest) for elastic beanstalk client AWS

I'm trying to follow the instructions here but no matter what I do it seems to be stuck on using Python 2.7.1 which is causing me errors currently.

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-osx.html

Attached is an image showing my logs of upgrading to the newest awsebccli but its still stuck saying 2.7.1 when it should say 3.6 (or newer)

What could I be doing wrong?

I want to note that I also installed the newest version of python3 and python via brew.

enter image description here

enter image description here

Here is the exact error I'm getting if it helps also.

enter image description here

like image 376
Joseph Astrahan Avatar asked Oct 18 '22 19:10

Joseph Astrahan


1 Answers

You do not want to upgrade the default python 2.7x installation or the python 3.x installation available on linux or OSX. There are usually lots of other libraries and applications that depend on this default installation. When you want to use a specific version of python the approach is to rely on a virtual enviorenment.

virtualenv is a tool to create isolated Python environments.

You are then leaving the system installation untouched. Getting the hang of virtualenv is quite easy. Once you create it (a one off task). All you need is to activate it and then you can use it as you would normally use the default python interpreter. How to copy packages from one virtualenv (or the system installation) to another is discussed here:

Installing python3 in a python2 virtual environment

like image 125
e4c5 Avatar answered Oct 21 '22 00:10

e4c5