Module not found, after installing with pip in stash
Hi, relative Python newcomer here, but with a couple of scripts under my belt, developed on Windows. I've been playing with Pythonista the last few days, but I'm struggling with one aspect. I've installed stash, from there installed some modules via pip, but the script I've written produces a Module Not Found error every time I run it.
My script resides in a folder under Documents/myapp on This iPad but when running it consistently fails to find the pip installed modules in site-packages-3. The modules in question are google.api_core and google.auth.
Is this some kind of permissions issue? Happy to give more information if it helps.
so, I will ask the obvious question....
does the site-packages-3/google/api_core folder exist?
if not, you may need to pip install google-api-core.
pip on pythonista does not always figure out every dependency. also, some pip installs fail, and you need to use wget to download, and tar to untar/gz to copy into site packages.
or, use the workng copy app to download modules from git and copy the appropriate folder to site-packages
Ah right, cheers for that Jon. Obvious questions are welcome at my level! That's pointed me in the right direction, it looks like pip hasn't picked up on the dependencies. Thanks for the advice with regards to workarounds.
Hello. Sorry if this is not right. But i would like to know how to install libraries in Pythonista please.
I have some personal files I’d like to use with “import”. Thank you
@3ryck there are a few ways to import files into pythonista... iCloud, share sheet, copy/paste.
Once in pythonista, move them into the My iPad folder (aka ~/Documents), then you can import them from scripts in the same folder. Alternatively, you may copy them to site-packages, where they are accessible to all scripts
Hi guys, I'm new to Pythonista 3.
I also got stuck with installing the google API modules. StaSh pip failed exactly the same way.
I do have working library in Jupyter in my Linux box and I can freely access my Google contacts. I can copy *.py files to the Pythonista 3 folder in iCloud drive, but the drive does not accept *.pth files. Furthermore, StaSh can only reach Document folder. I can't find the way to bring the copy into modules folder unless I jailbreak my phone.
In stash, site-packages, etc can be found in
I think in general .pth file don't work -- I think technically they might, but pythonista doesn't
import siteby default. Iirc you can import it yourself, or add to your pythonista_startup.py script.
I found 'google' folder under Standard Library (3.6)/site-packages.
I feel like this is the cause of conflict that prevents pip to install google libraries.
'Standard Library (3.6)' seems not an ordinary directory and I cannot find by StaSh.
This post is deleted!last edited by
@JonB I finally got it working.
I have working Google People API environment on anaconda3 in my Linux box. Archived google* files and directories in ~/anaconda3/lib/python3.7/site-packages, brought the tar ball in pythonista3 folder in iCloud, and restored in site-packages directory. To make it working, I also needed to PIP install six and httplib2. This time StaSh did the job.
Needless to say you've got to prepare credentials.json and put in in your working directory.