Unable to install boto in python3

微笑、不失礼 提交于 2019-12-06 19:54:47

问题


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

回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/10026153/unable-to-install-boto-in-python3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!