priya
priya

Reputation: 26759

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

Upvotes: 10

Views: 4349

Answers (2)

metakermit
metakermit

Reputation: 22351

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.

Upvotes: 2

Fred Foo
Fred Foo

Reputation: 363858

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.

Upvotes: 13

Related Questions