omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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?

    Pythonista
    4
    5
    4199
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dafire
      dafire last edited by

      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
      
      1 Reply Last reply Reply Quote 0
      • ihf
        ihf last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • Rothrock42
          Rothrock42 last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • ihf
            ihf last edited by

            Yes, at the interactive prompt.

            1 Reply Last reply Reply Quote 0
            • dgelessus
              dgelessus last edited by

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

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors