Forum Archive

cannot import requests, what am I doing wrong?

dafire

Hi all, i just got pythonista and wanted to get something from web.

I just tried to import requests, but it is not working... what am I doing wrong? I just put

import requests

in a python file or put in in the console and get the error:

Traceback (most recent call last):
 File "<string>", line 1, in <module>
 File "/var/mobile/Applications/57EA3542-012C-4A6F-BEB4-57327D8D7583/Pythonista.app/pylib/site-packages/requests/__init__.py", line 58, in <module>
   from . import utils
ImportError: cannot import name utils
ihf

import requests seems to work for me with no additional downloads. However, I have come across a strange bug. If I do:

import requests

r=requests.get('http://yahoo.com')

r.content

Then the moment I type the '.' in r.content the App freezes. I have repeated this on two iPads. I turned off auto-completion and it made no difference.

Rothrock42

@ihf This was typing at the python prompt, right? Happened to me to on the iPhone. It works fine when typing into a py document.

ihf

Yes, at the interactive prompt.

dgelessus

Ditto, I also always get a lot of lag when working with a requests response in the console.