Modules in pythonista template
Hello guys ,
I am stuck with a problem and i cant find the solution on the Internet thats why i Come to you ...
I want to create a standalone iOS app thanks to the phythonista
I successfully build the " hello world" app so now i need to replace the hello world script with my scripts !
My problem is that my scripts uses Python modules like pycrypto lxml etc wich are not pre installed in the version of python used to run the script on the Idevice...
I would like to integrate the modules i need in the version of Python bring on the end client device ( or make a script that installed thoose modules when client first run my app )
i have no idea how to do that !
Any ideas ?
Thanks a lot !
I don't have much experience with the app template, but for pure Python modules (that do not contain any C, Fortran, Assembler, etc. code) you need to place the module's folder or
.pyfile into the
For modules written in C, such as
lxml, you would need to do a lot more work, as they need to be compiled and linked to the Python/Pythonista binary in a way that works with iOS.
Cryptois already included with Pythonista though, so it should also be included in the app template by default.
Thank you for your answer !
There is 3 modules that i need to integrate : Twisted , pynacl and pyblake2 !
Pynacl relies on libsodium written in C ..
I ve always installed thoose modules using pip wich is obviously simpler :) i have no idea how to manualy install the modules ( compile and link to the Python binary)
Çan someone give me the steps to do that ?
Thanks in advance
No one knows how to do that or could redirect me some where with a tutorial ? 😨
Add them under your script folder. You can import from the same folder as your running program.
@NoBetterName That only works with pure Python modules (and
site-packagesis the preferred place to install those, but in the app template it doesn't matter too much). The question here is how to use libraries that use C code, which need to be compiled before they can be imported.
It worked for me with modules in C. I compiled them, and created a single .py file to import the c module. It worked for me, I don't know if I maybe changed a certain setting to make it work, but somehow it worked.
Huh, I would've expected that you need to configure the Xcode project properly to make it compile the extension modules into separate libraries and such. Then again, I don't really have much experience with the app template, so what do I know...