PyBox / Python libraries

NumPy, PyTorch, OpenCV and more, built for Android.

Installing scientific Python on a phone usually means failed builds. PyBox runs its own wheel registry of prebuilt Android packages, so pip just works.

TensorFlow LiteXGBooststatsmodelsPyArrowh5pyShapelypyprojPyMuPDFlxmlPyOpenGLsoundfileVoskSpeechRecognitionpyperclipnetworkxcryptographyPyNaClpyzmqtornadogrpciopsutiltiktokensentencepieceorjsonmsgspecty

Prebuilt, so pip does not compile

Packages like NumPy, SciPy, PyTorch and OpenCV contain native code. Building them on a phone is slow and often fails. PyBox points pip at a registry of wheels built for Android ARM and x86_64, so pip install numpy downloads a binary that runs. Pure-Python packages install from PyPI as usual.

Machine learning and GPU inference

PyTorch, torchvision and torchaudio are available, as are TensorFlow and TFLite, ONNX Runtime, ONNX, NCNN, MediaPipe and llama.cpp for local language models. TensorFlow, NCNN and ONNX Runtime can use GPU acceleration for inference. Hugging Face tokenizers, safetensors and sentencepiece cover the tooling around models.

Data and science

NumPy, pandas, SciPy, Matplotlib, scikit-learn, scikit-image, statsmodels, Numba, DuckDB, PyArrow, h5py, XGBoost and LightGBM cover analysis and classical machine learning. Shapely, pyproj and Astropy cover geospatial and astronomy work. PyMuPDF reads PDFs, and lxml parses XML and HTML.

Hardware and media

OpenCV (and opencv-contrib) read the camera. PyAudio, sounddevice and soundfile handle audio. Vosk, sherpa-onnx and SpeechRecognition do speech to text, and pyttsx3 does text to speech. pygame, PyOpenGL and Kivy cover games and GUI.

Install a package

Add the name to requirements.txt and tap Sync Project, or run pip install package in the terminal. Packages download once and then work offline.

Questions

Can I install NumPy and pandas on Android?

Yes. PyBox provides prebuilt Android wheels for NumPy, pandas, SciPy, Matplotlib and scikit-learn, so pip installs them without compiling.

Does PyTorch run on Android with PyBox?

Yes. PyTorch, torchvision and torchaudio are available as Android wheels, and Hugging Face tokenizers and safetensors work alongside them.

Does OpenCV work with the camera?

Yes. cv2.VideoCapture reads the Android camera after you grant permission.

Can I run a local LLM?

There is a llama.cpp Python binding, and an ONNX Runtime LLM Chat starter project. Speed depends on the device and the model size.

Try PyBox on your device.