Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
cannot import requests, what am I doing wrong?
-
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
-
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.
-
@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.
-
Yes, at the interactive prompt.
-
Ditto, I also always get a lot of lag when working with a requests response in the console.