2016-04-04 161 views
2

安装了boto3并将其升级到最新版本。我尝试了易于安装的安装点。我有多个版本的Python安装,所以我甚至尝试安装在virtualenv venv。但是我得到了同样的错误:“没有名为boto3的模块”。ImportError:没有名为boto3的模块

pip install boto3 

python 
Python 2.7.11 (default, Mar 10 2016, 14:12:44) 
[GCC 4.6.3] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import boto3 
Traceback (most recent call last): 
File "<stdin>", line 1, in <module> 
ImportError: No module named boto3 
>>> 

我试着用/没有sudo:

sudo pip install boto3 

我真的要安装在树莓派AWS SDK。

pip freeze 

显示安装了“boto3 == 1.3.0”。

sudo pip install boto3 

Requirement already satisfied (use --upgrade to upgrade): boto3 in /usr/local/lib/python2.7/dist-packages 
Requirement already satisfied (use --upgrade to upgrade): botocore>=1.4.1, <1.5.0 in /usr/local/lib/python2.7/dist-packages (from boto3) 
Requirement already satisfied (use --upgrade to upgrade): jmespath>=0.7.1,<1.0.0 in /usr/local/lib/python2.7/dist-packages (from boto3) 
Requirement already satisfied (use --upgrade to upgrade): futures>=2.2.0,<4.0.0 in /usr/local/lib/python2.7/dist-packages (from boto3) 
Requirement already satisfied (use --upgrade to upgrade): python-dateutil>=2.1,<3.0.0 in /usr/local/lib/python2.7/dist-packages (from botocore>=1.4.1,<1.5.0->boto3) 
Requirement already satisfied (use --upgrade to upgrade): docutils>=0.10 in /usr/local/lib/python2.7/dist-packages (from botocore>=1.4.1,<1.5.0->boto3) 
Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in /usr/local/lib/python2.7/dist-packages (from python-dateutil>=2.1,<3.0.0->botocore>=1.4.1,<1.5.0->boto3) 
Cleaning up... 

回答

3

sudo pip install boto3将其安装到您的全局点。这里解释:Unable to install boto3

您可以启动VENV,没有sudo安装boto3和启动蟒蛇:

$ source path/to/your/ENV/bin/activate 
$ pip install boto3 
$ python 

或者,如果你喜欢使用您的全局安装这样做:

$ deactivate 
$ pip install boto3 
$ python 

时退房virtualenv用户指南:https://virtualenv.pypa.io/en/latest/userguide.html

此外virtualenvwrapper使它很容易管理: https://virtualenvwrapper.readthedocs.org/en/latest/install.html

1

在全球范围内为我的MAC,这个工作

sudo pip install --ignore-installed six boto3 
0

我所面临的同样的问题,也没有使用虚拟环境。 easy_install正在为我工​​作。我使用Ubuntu 16.04和我的Python版本是2.7

easy_install boto3 
0

尝试激活您的虚拟环境

source bin/activate

然后尝试连接安装boto3

pip install boto3

相关问题