TermuxT
Termux3mo ago
15 replies
!hanshi

pydantic-core on termux

anyone having issue with python project development on termux? whether using vanilla pip, uv or poetry. everytime i add spotdl as dependency, it needs to compile pydantic-core. worse things happened with uv and poetry. everytime i run main.py, they both recompile pydantic-core and it took like 20 mins. does this related to the python version? i also read on several github issues about python on termux, most libraries aren't compatible with bionic libc or something
Solution
The development workflow I would recommend for Python in Termux is currently this:
1. Install
python-pip
and any other
python-*
dependencies that you need that are available from
pkg
in Termux
2. after that, do not use a virtualenv. Instead, use
pip install
unsandboxed directly to install any remaining PyPi dependencies you need that are not available from
pkg
, and just wait a long time, if you see an error, open a report about it.
3.
uv
has problems currently with Termux, there are several issues about this including an upstream issue, avoid it in favor of
pip
instead
4. just keep this state saved in your Termux while you do Python development, if you don't want to wait 20 minutes every time you use a new device, you can use
termux-backup
and
termux-restore
to transfer your Termux content to another device. This will only work if both devices are 32-bit ARM, or both devices are 64-bit ARM. If you need to transfer to another device that is a different architecture, then you have to do all your setup commands again and wait, there is no alternative
Was this page helpful?