Skip to main content

Python for Android

If you obtained this README as part of a release package, then the only applicable sections are "Prerequisites", "Testing", and "Using in your own app".

If you obtained this README as part of the CPython source tree, then you can also follow the other sections to compile Python for Android yourself.

However, most app developers should not need to do any of these things manually. Instead, use one of the tools listed here, which will provide a much easier experience.

Prerequisites

If you already have an Android SDK installed, export the ANDROID_HOME environment variable to point at its location. Otherwise, here's how to install it:

  • Download the "Command line tools" from https://developer.android.com/studio.
  • Create a directory android-sdk/cmdline-tools, and unzip the command line tools package into it.
  • Rename android-sdk/cmdline-tools/cmdline-tools to android-sdk/cmdline-tools/latest.
  • export ANDROID_HOME=/path/to/android-sdk

The android.py script will automatically use the SDK's sdkmanager to install any packages it needs.

The script also requires the following commands to be on the PATH:

  • curl
  • java (or set the JAVA_HOME environment variable)

Building

Python can be built for Android on any POSIX platform supported by the Android development tools, which currently means Linux or macOS.

First we'll make a "build" Python (for your development machine), then use it to help produce a "host" Python for Android. So make sure you have all the usual tools and libraries needed to build Python for your development machine.

The easiest way to do a build is to use the android.py script. You can either have it perform the entire build process from start to finish in one step, or you can do it in discrete steps that mirror running configure and make for each of the two builds of Python you end up producing.

The discrete steps for building via android.py are:

./android.py configure-build
./android.py make-build
./android.py configure-host HOST
./android.py make-host HOST

HOST identifies which architecture to build. To see the possible values, run ./android.py configure-host --help.

To do all steps in a single command, run:

./android.py build HOST

In the end you should have a build Python in cross-build/build, and a host Python in cross-build/HOST.

You can use -- as a separator for any of the configure-related commands – including build itself – to pass arguments to the underlying configure call. For example, if you want a pydebug build that also caches the results from configure, you can do:

./android.py build HOST -- -C --with-pydebug

Packaging

After building an architecture as described in the section above, you can package it for release with this command:

./android.py package HOST

HOST is defined in the section above.

This will generate a tarball in cross-build/HOST/dist, whose structure is similar to the Android directory of the CPython source tree.

Testing

The Python test suite can be run on Linux, macOS, or Windows.

On Linux, the emulator needs access to the KVM virtualization interface. This may require adding your user to a group, or changing your udev rules. On GitHub Actions, the test script will do this automatically using the commands shown here.

The test suite can usually be run on a device with 2 GB of RAM, but this is borderline, so you may need to increase it to 4 GB. As of Android Studio Koala, 2 GB is the default for all emulators, although the user interface may indicate otherwise. Locate the emulator's directory under ~/.android/avd, and find hw.ramSize in both config.ini and hardware-qemu.ini. Either set these manually to the same value, or use the Android Studio Device Manager, which will update both files.

You can run the test suite either:

  • Within the CPython repository, after doing a build as described above. On Windows, you won't be able to do the build on the same machine, so you'll have to copy the cross-build/HOST/prefix directory from somewhere else.

  • Or by taking a release package built using the package command, extracting it wherever you want, and using its own copy of android.py.

The test script supports the following modes:

  • In --connected mode, it runs on a device or emulator you have already connected to the build machine. List the available devices with $ANDROID_HOME/platform-tools/adb devices -l, then pass a device ID to the script like this:

    ./android.py test --connected emulator-5554
    
  • In --managed mode, it uses a temporary headless emulator defined in the managedDevices section of testbed/app/build.gradle.kts. This mode is slower, but more reproducible.

    We currently define two devices: minVersion and maxVersion, corresponding to our minimum and maximum supported Android versions. For example:

    ./android.py test --managed maxVersion
    

By default, the only messages the script will show are Python's own stdout and stderr. Add the -v option to also show Gradle output, and non-Python logcat messages.

Any other arguments on the android.py test command line will be passed through to python -m test – use -- to separate them from android.py's own options. See the Python Developer's Guide for common options – most of them will work on Android, except for those that involve subprocesses, such as -j.

Every time you run android.py test, changes in pure-Python files in the repository's Lib directory will be picked up immediately. Changes in C files, and architecture-specific files such as sysconfigdata, will not take effect until you re-run android.py make-host or build.

The testbed app can also be used to test third-party packages. For more details, run android.py test --help, paying attention to the options --site-packages, --cwd, -c and -m.

Using in your own app

See https://docs.python.org/3/using/android.html.

Metadata

Release files for goygram 0.8.27

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for goygram 0.8.27
File Size Uploaded Provenance Actions
goygram-0.8.27.tar.gz 278.6 kB Without provenance Details for goygram-0.8.27.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for goygram 0.8.27
File Actions
goygram-0.8.27-cp38-abi3-win_arm64.whl CPython 3.8 abi3 Windows ARM64 Details for goygram-0.8.27-cp38-abi3-win_arm64.whl
goygram-0.8.27-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for goygram-0.8.27-cp38-abi3-win_amd64.whl
goygram-0.8.27-cp38-abi3-musllinux_1_2_x86_64.whl CPython 3.8 abi3 Linux musl 1.2+ x86-64 Details for goygram-0.8.27-cp38-abi3-musllinux_1_2_x86_64.whl
goygram-0.8.27-cp38-abi3-musllinux_1_2_aarch64.whl CPython 3.8 abi3 Linux musl 1.2+ ARM64 Details for goygram-0.8.27-cp38-abi3-musllinux_1_2_aarch64.whl
goygram-0.8.27-cp38-abi3-manylinux_2_34_x86_64.whl CPython 3.8 abi3 Linux glibc 2.34+ x86-64 Details for goygram-0.8.27-cp38-abi3-manylinux_2_34_x86_64.whl
goygram-0.8.27-cp38-abi3-manylinux_2_28_aarch64.whl CPython 3.8 abi3 Linux glibc 2.28+ ARM64 Details for goygram-0.8.27-cp38-abi3-manylinux_2_28_aarch64.whl
goygram-0.8.27-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for goygram-0.8.27-cp38-abi3-macosx_11_0_arm64.whl
goygram-0.8.27-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.8 abi3 macOS 11.0+ ARM64, macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64) Details for goygram-0.8.27-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
goygram-0.8.27-cp38-abi3-android_24_x86_64.whl CPython 3.8 abi3 Android API level 24+ x86-64 Details for goygram-0.8.27-cp38-abi3-android_24_x86_64.whl
goygram-0.8.27-cp38-abi3-android_24_arm64_v8a.whl CPython 3.8 abi3 Android API level 24+ ARM64 v8a Details for goygram-0.8.27-cp38-abi3-android_24_arm64_v8a.whl

Total release size: 6.5 MB

Release files / goygram-0.8.27.tar.gz

Download URL goygram-0.8.27.tar.gz
Size 278.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e53b311e55cd96326a1242fc9f16f774117f6c3e8b1c072980fdae28d107401e
BLAKE2b-256 checksum
How to use checksums
55627783a7f9f023fe3afca77ba33742d5efddc6f3c0b7fe88c904b685e88148
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / goygram-0.8.27-cp38-abi3-win_arm64.whl

Download URL goygram-0.8.27-cp38-abi3-win_arm64.whl
Size 484.3 kB
Tags CPython 3.8 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
7451cd8bc43a2a1e1e4ab33c6c6d1db17cd6a53eb85dd1aee49b497bd7724b14
BLAKE2b-256 checksum
How to use checksums
7b8f714036afd719a67b726ab544d9a2791a49ab6a60d3036f872745ebe36c81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / goygram-0.8.27-cp38-abi3-win_amd64.whl

Download URL goygram-0.8.27-cp38-abi3-win_amd64.whl
Size 497.9 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c70afe28119730bf1e5a94f4966fc7611ee74f70f8b9e1e70e8cdff46d245ed4
BLAKE2b-256 checksum
How to use checksums
2b44e1ade9f5f245ea1eef17dabef1cd4cfea05790ad1c09b2158421ec6443b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / goygram-0.8.27-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL goygram-0.8.27-cp38-abi3-musllinux_1_2_x86_64.whl
Size 793.3 kB
Tags CPython 3.8 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
bdf2cfcb2f089757b1c1e21c7debaf46f687daed4c1bbd112ed361c0503a198e
BLAKE2b-256 checksum
How to use checksums
38e6089a22af63904ded5455bb09d5323c5ffab4c91a2fb5c09ba2fe01c39e31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / goygram-0.8.27-cp38-abi3-musllinux_1_2_aarch64.whl

Download URL goygram-0.8.27-cp38-abi3-musllinux_1_2_aarch64.whl
Size 745.4 kB
Tags CPython 3.8 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
d49786f87bd6b999a7090a9074f21e744db4640a32967661bbc0bcb1612adf24
BLAKE2b-256 checksum
How to use checksums
40f1c653b0d898d628bc812003f7527a265cee3a8e215230f47ee9e97fc59b31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / goygram-0.8.27-cp38-abi3-manylinux_2_34_x86_64.whl

Download URL goygram-0.8.27-cp38-abi3-manylinux_2_34_x86_64.whl
Size 581.3 kB
Tags CPython 3.8 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
f90060b9a5feaae1f51146a3261f0b6d77979d0b7704ebed446b2de6cfd46294
BLAKE2b-256 checksum
How to use checksums
a0b0302e579af06399a206f8080983631f1f656016cb515aa45f3bc28e1534c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / goygram-0.8.27-cp38-abi3-manylinux_2_28_aarch64.whl

Download URL goygram-0.8.27-cp38-abi3-manylinux_2_28_aarch64.whl
Size 566.5 kB
Tags CPython 3.8 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
9d36ac69ff4f1c2e4b530a53ac556628aa9f4fa9af7f9432c0e8534c96cb2f9a
BLAKE2b-256 checksum
How to use checksums
b27c757549c57212345de4555b62f97dc256db153da80610f14def8ffb9eeb6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / goygram-0.8.27-cp38-abi3-macosx_11_0_arm64.whl

Download URL goygram-0.8.27-cp38-abi3-macosx_11_0_arm64.whl
Size 552.7 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1ecdd5f4f31c71734078826a1e62438e7ccfc32a2a1e58910d9ff8da9022e829
BLAKE2b-256 checksum
How to use checksums
bc26d5e050f1e6a13075d9bf1eb7a76478c462cec62d06337c71d2eb5e3367e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / goygram-0.8.27-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL goygram-0.8.27-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 834.4 kB
Tags CPython 3.8 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
953253e201777b709f709e2536f94705b004a523166183ec9f2b0a6ca27b9adc
BLAKE2b-256 checksum
How to use checksums
17bfc40c88c30a3ce7dac155676cfacae45d133ab3cfe473638b0d673f6f12b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / goygram-0.8.27-cp38-abi3-android_24_x86_64.whl

Download URL goygram-0.8.27-cp38-abi3-android_24_x86_64.whl
Size 592.3 kB
Tags Android API level 24+ x86-64 CPython 3.8 abi3
SHA-256 checksum
How to use checksums
b4d7623063b2b00063b97837062b285b84b653f77f1d117e1174073af39b4311
BLAKE2b-256 checksum
How to use checksums
2c1a448e12d1280bbec7a25ca7f5f886170a0d38f48137a2879e69c90571df81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Release files / goygram-0.8.27-cp38-abi3-android_24_arm64_v8a.whl

Download URL goygram-0.8.27-cp38-abi3-android_24_arm64_v8a.whl
Size 576.1 kB
Tags Android API level 24+ ARM64 v8a CPython 3.8 abi3
SHA-256 checksum
How to use checksums
d9e321dcf1dce97b2525bd7111a47d7c2b927d33122a1f93fce98b7a364316f0
BLAKE2b-256 checksum
How to use checksums
6be4ca5e0087901bc65596fc98e390594f8409189cc8800ad1019b997083844d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.15.0

Security for goygram 0.8.27

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.27 This release

11 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page