git aws.push:没有名为 boto 的模块
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23297719/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git aws.push: No module named boto
提问by user2988464
i'm trying to follow the tutorial: deploy django on aws Elastic Beanstalk
我正在尝试按照教程:在 aws Elastic Beanstalk 上部署 django
when i'm doing the Step 6's substep 5:
当我在做第 6 步的第 5 步时:
git aws.push
I get a ImportError message:
我收到一条导入错误消息:
(tryhasinenv)Lee-Jamess-MacBook-Pro:tryhasin h0925473$ git aws.push
Traceback (most recent call last):
File ".git/AWSDevTools/aws.elasticbeanstalk.push", line 21, in <module>
from aws.dev_tools import *
File "/Users/h0925473/tryhasin_root/tryhasin/.git/AWSDevTools/aws/dev_tools.py", line 5, in <module>
import boto
ImportError: No module named boto
I have no idea what to do. Can somebody tell me what's wrong?
我不知道该怎么做。有人能告诉我出了什么问题吗?
回答by Jaime Fournier
On OSX I found that pip install boto
did not resolve the issue.
The problem was that python was not pointing to the pip installation.
export PYTHONPATH=/usr/local/lib/python2.7/site-packages
resolved this for me.
在 OSX 上,我发现这pip install boto
并没有解决问题。问题是 python 没有指向 pip 安装。
export PYTHONPATH=/usr/local/lib/python2.7/site-packages
为我解决了这个问题。
回答by Andy Jarrett
I solved this separately by running:
我通过运行单独解决了这个问题:
$ sudo easy_install pip
This uses the default python package installer to install PIP
这使用默认的 python 包安装程序来安装 PIP
$ sudo pip install boto
I needed Admin rights to add boto (I don't know if thats right or not).
我需要管理员权限才能添加 boto(我不知道这是否正确)。
Then ran $ eb start
然后跑了 $ eb start
回答by Alex
Did you pip freeze > requirements.txt
after you ran pip install boto
?
pip freeze > requirements.txt
你跑了之后pip install boto
吗?
You need to update your requirements.txt
after each time you install a new python package locally to ensure your AWS instance has all the required packages as well.
requirements.txt
每次在本地安装新的 Python 软件包时,您都需要更新您的after,以确保您的 AWS 实例也具有所有必需的软件包。
EDIT:
编辑:
In case you aren't the one who wrote boto
in, you'll need to install it and then pip freeze it yourself.
如果您不是写信boto
的人,您需要安装它,然后自己 pip 冻结它。
Try running the following commands:
尝试运行以下命令:
pip install boto
pip freeze > requirements.txt
git add .
git commit -m "Added boto"
git aws.push
回答by Falko Menge
I had a similar issue with Ansible and fixed it using:
我在 Ansible 上遇到了类似的问题并使用以下方法修复了它:
sudo apt install python-boto