Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install boto in python3

I am trying to install boto from the source code / pypi, but I am unable to install it using python 3.2. Why is it failing?

c:\boto>..\Python32\python.exe setup.py install
Traceback (most recent call last):
  File "setup.py", line 35, in <module>
    from boto import __version__
  File "c:\boto\boto\__init__.py", line 26, in <mod
ule>
    from boto.pyami.config import Config, BotoConfigLocations
  File "c:\boto\boto\pyami\config.py", line 185
    print s.getvalue()
          ^
SyntaxError: invalid syntax
like image 892
priya Avatar asked Apr 05 '12 09:04

priya


2 Answers

print s.getvalue()

is Python 2 syntax. From the README:

If you are interested in trying out boto with Python 3.x, check out the neo branch. This is under active development and the goal is a version of boto that works in Python 2.6, 2.7, and 3.x. Not everything is working just yet but many things are and it's worth a look if you are an active Python 3.x user.

like image 189
Fred Foo Avatar answered Oct 07 '22 00:10

Fred Foo


I got it working on Python 3 by installing from the develop branch as the PyPI version did not work at the time of writing. E.g. add this to your requirements.txt:

git+https://github.com/boto/boto.git@develop

Once you find a working version, it's good to freeze your dependency to a specific commit, e.g.:

git+https://github.com/boto/boto.git@5a28d1c6a3b11b979bf32ea7fbfd6d5156c01395

(ideally, of course, we wouldn't need to install from a repository in the first place :)

Update 2015 – can be installed directly from PyPI. See David's comment below.

like image 27
metakermit Avatar answered Oct 06 '22 22:10

metakermit