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.


    Downloading modules from the internet?

    Pythonista
    5
    9
    4651
    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.
    • dorien_jansen
      dorien_jansen last edited by

      I'm new her and I was wondering if it is possible to download custom modules from the web?

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

        Yes, you can use stash for that. In most cases you can use its pip command to install a module from PyPI automatically. If that doesn't work or the module is not on PyPI, you can download it manually with wget, unpack it with tar or unzip, and move the correct folder to site-packages by hand.

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

          Awesome! Thanks for your help 😊

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

            Does anyone know how i can download urllib.request?

            Webmaster4o 1 Reply Last reply Reply Quote 0
            • Webmaster4o
              Webmaster4o @dorien_jansen last edited by

              @dorien_jansen just import urllib. urllib.request is part of the standard library.

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

                That is a module from the Python 3 standard library. Pythonista currently uses Python 2, where you'd use urllib2. If you're trying to run a script that imports urllib.request, then it's written for Python 3 and can't run on the current Pythonista. (A Python 3 version of Pythonista is currently in beta, though as far as I know it won't be released for a while.)

                1 Reply Last reply Reply Quote 1
                • dorien_jansen
                  dorien_jansen last edited by

                  Thanks for the info, I'll wait for the final release

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

                    try:                 # Python 3 and later
                        from urllib.request import urlopen
                    except ImportError:  # Python 2
                        from urllib2 import urlopen
                    
                    1 Reply Last reply Reply Quote 0
                    • Tizzy
                      Tizzy last edited by

                      also, using the Pip command in Stash you can install from github repos using pip install UserName/ProjectName

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