Forum Archive

Using modules not included in Pythonista

ChrisHare

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

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

ChrisHare

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.

ellie_ff1493
from boto3 import *
#or
import boto3
mikael

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