Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git aws.push: No module named boto

i'm trying to follow the tutorial: deploy django on aws Elastic Beanstalk

when i'm doing the Step 6's substep 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?

like image 432
user2988464 Avatar asked Apr 25 '14 15:04

user2988464


4 Answers

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.

like image 95
Jaime Fournier Avatar answered Nov 03 '22 08:11

Jaime Fournier


I solved this separately by running:

$ sudo easy_install pip

This uses the default python package installer to install PIP

$ sudo pip install boto 

I needed Admin rights to add boto (I don't know if thats right or not).

Then ran $ eb start

like image 26
Andy Jarrett Avatar answered Nov 03 '22 09:11

Andy Jarrett


Did you pip freeze > requirements.txt after you ran 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.

EDIT:

In case you aren't the one who wrote boto in, you'll need to install it and then pip freeze it yourself.

Try running the following commands:

pip install boto
pip freeze > requirements.txt
git add .
git commit -m "Added boto"
git aws.push
like image 42
Alex Avatar answered Nov 03 '22 09:11

Alex


I had a similar issue with Ansible and fixed it using:

sudo apt install python-boto
like image 33
Falko Menge Avatar answered Nov 03 '22 07:11

Falko Menge