Saturday, October 30, 2021

[SOLVED] Running python apps with dependencies in termux

Issue

This may just be a linux question but I wish to run a python app in termux that I found on github that references another project in github.

I'm aware of linux 'packages' and have installed openssl package and other stuff on termux, but I've not done much coding on linux and am unaware how references will be resolved. Coming from c# I'd either look for something in nuget or import the code myself, and in this instance, if I mash the two git repos into adjacent folders and use visual studio to set "search paths" and stuff then the code runs fine, but thats on my local windows machine.

Can someone help me with the general requirements of resolving dependencies on termux when running custom python code?


Solution

As per @Federico's comment, because the dependency has a "setup.py" file I could follow this answer about pip and these are the steps I took:

ran "pkg install python", which installed python and pip

then copied the git repo to my phone (git clone isn't working for whatever reason)

then navigated to the code and ran "pip install ." (notice the full stop on the end)

then copied the main code to my phone and ran "python <filename.py>" and it ran with no problems.



Answered By - Ninjanoel