Skip to content

Not working #112

Description

@anshm-2166
rudra@rudra:~/crossenv/usr/bin$ python3 -m crossenv /home/rudra/crossenv/usr/bin/python3 venv
WARNING: The cross-compiler ('/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang') does not appear to be for the correct architecture (got aarch64-unknown-linux-android24, expected aarch64-unknown-linux-android). Use --cc to correct, if necessary.
ERROR: Command '['/home/rudra/crossenv/usr/bin/venv/build/bin/python3', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
rudra@rudra:~/crossenv/usr/bin$

This is the error I face when setting up crossenv. Kindly rectify this.

Activity

  1. pmp-p commented on Jan 12, 2024

    @pmp-p

    why r25b ? isn't current LTS r26b ?

  2. anshm-2166 commented on Jan 13, 2024

    @anshm-2166
    Author

    Tried with ndk r26b too, doesn't make any difference

  3. benfogle commented on Jan 13, 2024

    @benfogle
    Collaborator

    While I get this set up, can you run with -vv to get debug output? That might give us a clue about what's going wrong.

    Also: Which Python version(s) are you using?

  4. anshm-2166 commented on Jan 13, 2024

    @anshm-2166
    Author

    Python 3.11.7

  5. alanliska commented on May 14, 2025

    @alanliska

    I also face to similar problem. Version of Python is 3.15.0a0, both the build as well as the host (cross-compiled). Cross-compilation did well, the resulting binaries seem to be working in Android devices. The Debian used does not contain any other Python installation. As soon as I try to create the virtual environment, such typical error alert occurs (independent on the Android platform chosen, either arm-linux-androideabi like here, or aarch64-linux-android, i686-linux-android, x86_64-linux-android):

    /home/debian/CROSSENV2/python_experimental/bin/python3 -m crossenv /home/debian/CROSSENV/cpython/cross-build/arm-linux-androideabi/python venv
    WARNING: The cross-compiler ('/mnt/d/Android/Sdk/ndk/27.1.12297006/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang') does not appear to be for the correct architecture (got armv7a-unknown-linux-android24, expected arm-unknown-linux-androideabi). Use --cc to correct, if necessary.
    Fatal Python error: init_import_site: Failed to import the site module
    Python runtime state: initialized
    Traceback (most recent call last):
    File "/home/debian/CROSSENV/venv/lib/site.py", line 176, in
    File "/home/debian/CROSSENV/venv/lib/site.py", line 121, in init
    File "/home/debian/CROSSENV/venv/lib/site.py", line 169, in manually_patch_loaded
    File "/home/debian/CROSSENV/venv/lib/site.py", line 55, in _patch_module
    File "", line 1, in
    File "", line 1371, in _find_and_load
    File "", line 1333, in _find_and_load_unlocked
    File "", line 1267, in _find_spec
    File "", line 18, in _PathFinder_find_spec
    File "/home/debian/CROSSENV2/python_experimental/lib/python3.15/sysconfig/init.py", line 495, in get_path
    File "/home/debian/CROSSENV2/python_experimental/lib/python3.15/sysconfig/init.py", line 485, in get_paths
    File "/home/debian/CROSSENV2/python_experimental/lib/python3.15/sysconfig/init.py", line 264, in _expand_vars
    File "/home/debian/CROSSENV2/python_experimental/lib/python3.15/sysconfig/init.py", line 612, in get_config_vars
    File "/home/debian/CROSSENV2/python_experimental/lib/python3.15/sysconfig/init.py", line 513, in _init_config_vars
    File "/home/debian/CROSSENV2/python_experimental/lib/python3.15/sysconfig/init.py", line 381, in _init_posix
    File "/home/debian/CROSSENV2/python_experimental/lib/python3.15/sysconfig/init.py", line 361, in _get_sysconfigdata
    File "/home/debian/CROSSENV2/python_experimental/lib/python3.15/importlib/init.py", line 88, in import_module
    File "", line 1398, in _gcd_import
    File "", line 1371, in _find_and_load
    File "", line 1333, in _find_and_load_unlocked
    File "", line 1267, in _find_spec
    File "", line 18, in _PathFinder_find_spec
    File "/home/debian/CROSSENV2/python_experimental/lib/python3.15/sysconfig/init.py", line 495, in get_path
    File "/home/debian/CROSSENV2/python_experimental/lib/python3.15/sysconfig/init.py", line 485, in get_paths
    File "/home/debian/CROSSENV2/python_experimental/lib/python3.15/sysconfig/init.py", line 274, in _expand_vars
    File "/home/debian/CROSSENV2/python_experimental/lib/python3.15/sysconfig/init.py", line 250, in _subst_vars
    AttributeError: 'installed_base'
    ERROR: Command '['/home/debian/CROSSENV/venv/cross/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'install', '--ignore-installed', '--prefix=/home/debian/CROSSENV/venv/cross', 'pip==25.1.1']' returned non-zero exit status 1.

  6. locked and limited conversation to collaborators on Sep 12, 2025
  7. converted this issue into a discussion #140 on Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions