1

I'm following this tutorial: http://boto.cloudhackers.com/en/latest/cloudsearch_tut.html

I've installed boto 2.6. The command:

conn = boto.connect_cloudsearch()

produces the error:

>>> conn = boto.connect_cloudsearch()Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "boto/__init__.py", line 616, in connect_cloudsearch
    from boto.cloudsearch.layer2 import Layer2
  File "boto/cloudsearch/layer2.py", line 26, in <module>
    from .domain import Domain
  File "boto/cloudsearch/domain.py", line 34, in <module>
    from .document import DocumentServiceConnection
  File "boto/cloudsearch/document.py", line 30, in <module>
    import requests
ImportError: No module named requests

How do I find the missing requests module?

waigani
  • 3,570
  • 5
  • 46
  • 71

5 Answers5

6

requests is a third-party module that is a pre-resquite for that module, either do:

pip install requests

or

easy_install requests

If these don't work for you, it is on github.

Having this module will then give you access to boto.

Hairr
  • 1,088
  • 2
  • 11
  • 19
2

At time of writing, boto (2.8.0) requires a pretty old requests module, specifically

pip install requests==0.14.2

if you use >1.0.0 when using document.doc_service.commit() you get

TypeError: request() got an unexpected keyword argument 'config'
Richard Aplin
  • 262
  • 2
  • 6
1

Got it. On the command line type:

easy_install requests
waigani
  • 3,570
  • 5
  • 46
  • 71
0

The requests module is a third party library for simplifying HTTP from Python. Info and installation instructions can be found on PyPi http://pypi.python.org/pypi/requests

You should use pip to install boto which will download necessary requirements, including requests. The other requirements are captured in the requirements.txt file in the boto source.

pip install boto
Emil Sit
  • 22,894
  • 7
  • 53
  • 75
0

I can verify that a requests upgrade from 0.14.1 to version 0.14.2 cleared up the issues I was having with a similar error. I was initially confused because most people upgrade boto to 2.4 or higher and fixed the problem.

Just a note - I specifically installed 0.14.2 - not 1.0 or higher, which has its own problems in our setup.

edgesrazor
  • 108
  • 6