ImportError:没有名为boto3的模块

时间:2016-04-04 00:06:04

标签: raspberry-pi2 boto3

安装了boto3并将其升级到最新版本。我尝试了简易安装点进行安装。我安装了多个版本的python,所以我甚至尝试在virtualenv venv中安装。但是我得到了同样的错误:"没有名为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

我正在尝试在Raspberry Pi上安装AWS SDK。

pip freeze

显示&#34; boto3 == 1.3.0&#34;安装。

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...

4 个答案:

答案 0 :(得分:3)

sudo pip install boto3将它安装到您的全球点。在此解释:Unable to install boto3

你可以激活你的venv,在没有sudo的情况下安装boto3并启动python:

$ 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 :(得分:1)

全球范围内,我的Mac,这工作

sudo pip install --ignore-installed six boto3

答案 2 :(得分:0)

我遇到了同样的问题,也没有使用虚拟环境。 easy_install正在为我工​​作。我使用的是Ubuntu 16.04,而我的python版本是2.7

{{1}}

答案 3 :(得分:0)

尝试激活您的虚拟环境

  

source bin / activate

然后尝试连接安装boto3

  

pip install boto3