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.


    Using modules not included in Pythonista

    Pythonista
    4
    5
    2949
    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.
    • ChrisHare
      ChrisHare last edited by

      I am new to Pythonista - like 30 minutes new.

      I am writing code which interacts with the boto3 module for AWS. Additionally, I reuse a lot of code, and I need to also be able to import my own code.

      When I do

      import boto3 
      

      Pythonista correctly reports it doesn't know anything about the module. How do i get it into Pythonista?

      Thanks

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

        https://github.com/ywangd/stash has to be installed first and that contains pip to allow you to pip install xyz as long as xyz is a pure Python module (no C code).

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

          Ok - I got boto3 installed now - thank you for that. How do I tell Pythonista to load my own module, which is in the same directory as the code I am working on.

          mikael 1 Reply Last reply Reply Quote 0
          • ellie_ff1493
            ellie_ff1493 last edited by ellie_ff1493

            from boto3 import *
            #or
            import boto3
            
            1 Reply Last reply Reply Quote 0
            • mikael
              mikael @ChrisHare last edited by

              @ChrisHare, just import with the file’s name without the .py extension, but note that your file name must fit Python syntax (import my_module works, but import my-module will not).

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