AWS aws.push ImportError: No module named boto in

2019-04-18 09:05发布

I'm trying to follow this tutorial: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Ruby_rails.html

in order to deploy a Ruby on Rails app in AWS with Ubuntu.

Everything went ok (I can run my app in local), until the final step. When I run aws.push I get next error.

   roberto@ubuntu:~/dev/myapp$ git aws.push
Traceback (most recent call last):
  File ".git/AWSDevTools/aws.elasticbeanstalk.push", line 21, in <module>
    from aws.dev_tools import * 
  File "/home/roberto/dev/myapp/.git/AWSDevTools/aws/dev_tools.py", line 5, in <module>
    import boto
ImportError: No module named boto

I have read this post git aws.push: No module named boto and run:

pip install boto
pip freeze > reqIuirements.txt
git add .
git commit -m "Added boto"
git aws.push

But still the same result.

UPDATE: I think the problem is related to my python versions. When I run which python I get /usr/bin/python. If I do ls this folder I see python, python2, python2.7, python3, python3.4.

When I run python I get:

Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

I don't know what to do.

The problem was the first boto installation it didn't work due to permissions problems, and I didn't realize. I ran sudo pip install boto and everything went OK this time.

8条回答
劫难
2楼-- · 2019-04-18 09:34

If on OSX w/o pip installed:

sudo easy_install pip
sudo pip install boto
查看更多
姐就是有狂的资本
3楼-- · 2019-04-18 09:42

Doing these 3 steps helps in cases there are any error with installing pip/python first.

$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python get-pip.py 
$ sudo pip install boto

Or if you are on Mac, then you can try installing Python3.

https://www.python.org/ftp/python/3.5.2/python-3.5.2-macosx10.6.pkg then, Install it (UI way if you want to).

$ sudo pip3 install boto
查看更多
登录 后发表回答