简体   繁体   中英

awscli running with python 2.7 on OS x Sierra

I'm having an issue with my awscli version + python versions installed on my Mac. After several tries following this I managed to have it working, however, if i run aws --version I get aws-cli/1.11.170 Python/2.7.10 Darwin/16.7.0 botocore/1.7.28

This confused me because I thought I had just installed python 3.6, so I decided to run which python , and it returned /usr/bin/python

I was still unsure and after some research I found this:

$which python3 /Library/Frameworks/Python.framework/Versions/3.6/bin/python3

Now i'm totally unsure which python version is the "main" one and if it is affecting my awscli, i plan to create a restapi using aws SDK with boto3 for Python.

How can i clean my python install or simply make sure my Mac is ready to work with the aws SDK + python?

PS.: I've tried this to uninstall python 2.6, 2.7 and 3.6 (currently installed on my system i suppose) but nothing really happened.

Thanks in advance for the help!

I would recommend creating a virtual environment to create an isolated environment for all the packages in your project. You can create a virtual environment of a specific python version using the following syntax in your shell:

$ python3.6 -m venv env

One you activate the virtual environment, you can use pip to install packages into your local python instance:

$ source env/bin/activate
(env) $ pip install awscli

Whenever you plan to run your application, or install packages for the project, simply activate the virtual environment.

For more information, see the documentation for the venv module in Python's standard library.

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