适用于Elastic Beanstalk客户端AWS的Mac上的Python从2.7升级到3.6(或最新) [英] Upgrade Python on Mac from 2.7 to 3.6 (or newest) for elastic beanstalk client AWS

查看:93
本文介绍了适用于Elastic Beanstalk客户端AWS的Mac上的Python从2.7升级到3.6(或最新)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图按照此处的说明进行操作,但是无论我做什么,似乎都停留在使用Python 2.7.1上,这目前导致我出错.

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

随附的图像显示了我升级到最新awsebccli的日志,但是当它应该说3.6(或更高版本)时仍然停留在说2.7.1

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)

我做错了什么?

我想指出的是,我还通过brew安装了最新版本的python3和python.

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.

推荐答案

您不想升级linux或OSX上可用的默认python 2.7x安装或python 3.x安装.通常,还有许多其他库和应用程序都依赖于此默认安装.当您想使用特定版本的python时,方法是依靠虚拟环境

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是用于创建隔离的Python环境的工具.

virtualenv is a tool to create isolated Python environments.

然后将不影响系统安装.掌握virtualenv的窍门是很容易的.一旦创建(一次性任务).您所需要做的就是激活它,然后可以像通常使用默认的python解释器一样使用它.此处讨论了如何将软件包从一个virtualenv(或系统安装)复制到另一个虚拟环境:

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:

在python2中安装python3虚拟环境

这篇关于适用于Elastic Beanstalk客户端AWS的Mac上的Python从2.7升级到3.6(或最新)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆