简体   繁体   中英

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.

在此输入图像描述

在此输入图像描述

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

在此输入图像描述

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM