Code Monkey home page Code Monkey logo

python3-android's People

Contributors

grredwings avatar nverbeek avatar shizmob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

python3-android's Issues

Reason for Default API 23 ?

I think minimum supported version API 21 from Readme. Is there any reason default is API 23 in build.sh ?

And what is -slim in python-slim, is this a stripped version ?

bug :Cross compilation error

NDK version:android-ndk-r26c-linux

Error message:

libtool: compile:  /android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android23-clang -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -I/python3-android/src/Python-3.11.0/Android/sysroot/usr/include -Wall -fPIC -fexceptions -MT src/closures.lo -MD -MP -MF src/.deps/closures.Tpo -c src/closures.c -o src/closures.o
In file included from src/closures.c:570:
./src/dlmalloc.c:3390:7: warning: variable 'nfences' set but not used [-Wunused-but-set-variable]
  int nfences = 0;
      ^
1 warning generated.
depbase=`echo src/tramp.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool  --tag=CC   --mode=compile /android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android23-clang -DHAVE_CONFIG_H -I.  -I. -I./include -Iinclude -I./src -I/python3-android/src/Python-3.11.0/Android/sysroot/usr/include  -Wall -fPIC -fexceptions -MT src/tramp.lo -MD -MP -MF $depbase.Tpo -c -o src/tramp.lo src/tramp.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  /android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android23-clang -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -I/python3-android/src/Python-3.11.0/Android/sysroot/usr/include -Wall -fPIC -fexceptions -MT src/tramp.lo -MD -MP -MF src/.deps/tramp.Tpo -c src/tramp.c -o src/tramp.o
src/tramp.c:262:22: error: call to undeclared function 'open_temp_exec_file'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  tramp_globals.fd = open_temp_exec_file ();
                     ^
1 error generated.
make[2]: *** [Makefile:1320: src/tramp.lo] Error 1
make[2]: Leaving directory '/python3-android/src/Python-3.11.0/Android/deps/libffi-3.4.4'
make[1]: *** [Makefile:1397: all-recursive] Error 1
make[1]: Leaving directory '/python3-android/src/Python-3.11.0/Android/deps/libffi-3.4.4'
make: *** [Makefile:625: all] Error 2
Traceback (most recent call last):
  File "/python3-android/src/Python-3.11.0/./Android/build_deps.py", line 172, in <module>
    main()
  File "/python3-android/src/Python-3.11.0/./Android/build_deps.py", line 169, in main
    build_package(pkg_cls(args.target_arch_name, args.android_api_level))
  File "/python3-android/src/Python-3.11.0/./Android/build_deps.py", line 147, in build_package
    pkg.build()
  File "/python3-android/src/Python-3.11.0/./Android/build_deps.py", line 26, in build
    self.make()
  File "/python3-android/src/Python-3.11.0/./Android/build_deps.py", line 39, in make
    self.run(['make'])
  File "/python3-android/src/Python-3.11.0/./Android/build_deps.py", line 22, in run
    subprocess.check_call(cmd, cwd=cwd)
  File "/usr/local/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make']' returned non-zero exit status 2.

Look forward to your fixing this problem. Thank you

Load CHECK 'did_read_' failed on SDK: 29

I'm getting the following error on Android SDK:29
Any help is appreciated..

/data/local/tmp/build/usr/bin # ./python3                                                                                                                                                              
bionic/linker/linker_phdr.cpp:168: Load CHECK 'did_read_' failed
Aborted 

How to include any custom module or any other python module

Hi,

Thank you for making nice setup.

I am trying to add numpy, scipy and opencv into this.

But here i saw you have kept some patch. how to make them what are those really? Are there kind of makefile?

And in source if i keep any official link that should work fine or not.

Can you please help me in this.

Thank you.

Hello. How to build with sqlite?

Hello. I have a problem after compile it.
I need to add sqlite3 to this.
How can i do it?
I tried to add this in docker-build.sh, but i get a problem.
My docker file :
`#!/bin/bash

set -e
set -x

apt-get update -y
apt-get install -y autoconf-archive autoconf automake cmake gawk gettext git gcc make patch pkg-config libsqlite3-dev
pip install pysqlite3

export ANDROID_NDK=/android-ndk

if [ ! -d "$ANDROID_NDK" ] ; then
# In general we don't want download NDK for every build, but it is simpler to do it here
# for CI builds
NDK_VER=r25b
apt-get install -y wget zip
wget --no-verbose https://dl.google.com/android/repository/android-ndk-$NDK_VER-linux.zip
unzip android-ndk-${NDK_VER}-linux.zip
ANDROID_NDK=/android-ndk-$NDK_VER
fi

cd /python3-android

./build.sh "$@"`

I have this error on my phone
`SyntaxError: invalid syntax

import sqlite3
Traceback (most recent call last):
File "", line 1, in
File "/data/local/tmp/build/usr/lib/python3.11/sqlite3/init.py", line 57, in
from sqlite3.dbapi2 import *
File "/data/local/tmp/build/usr/lib/python3.11/sqlite3/dbapi2.py", line 27, in
from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
`
Where can i add sqlite3 module?

Error on Copying /build Files

Hi, there is an issue while copying all /build files into /data/local/tmp.
image
As pic shows, the copying operation failed with "Permission denied". To solve this problem, I rooted my phone and found "adb root" works.
So I wonder that whether my Android device must be rooted or not. If not, could u tell me how to solve the "Permission denied" problem? thx.

Error in Building

stat /python3-android/docker-build.sh: no such file or directory: unknown.
2022-04-30_19h45_04

build.sh is also having issues.

  1. No command named autoreconf. Fixes with sudo apt-get install autoconf
  2. No Module named dataclasses Fixes with installing python3.9 (dataclasses was introduced in python 3.7)
  3. Finally getting this error now.

image

How to run py code provided by user

I would like to interpret python 3 code provided as a string.

Would you like to help me / add a simple code interpreter to examples?

Regards

How can I enable -fPIE

even when i set CFLAGSEXTRA to include -fPIE, it seems somewhere in the build process, -fPIC is added, causing the resulting binary to be build with PIC. Is there any particular way to disable the -fPIC?

import requests!!!

image

step 1: Py_SetPath is deprecated, please add sys.path
sys.path.append("/data/user/0/com.example.pythontest/files/Python64/") sys.path.append("/data/user/0/com.example.pythontest/files/Python64/lib-dynload")

step 2: fix collections.MutableMapping -> collections.abc.MutableMapping
maybe need cross compile again.

Help.....

The compilation was successful, but there are exceptions during runtime. There are issues with dynamic libraries when importing modules.

import math
Traceback (most recent call last):
File "", line 1, in
ImportError: dlopen failed: cannot locate symbol "PyExc_ValueError" referenced by "/data/local/tmp/build/usr/lib/python3.12/lib-dynload/math.cpython-312.so"...

image

lf -s /data/local/tmp/build/usr/lib/python3.12/lib-dynload/math.cpython-312.so |grep PyExc_ValueError <
10: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND PyExc_ValueError
203: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND PyExc_ValueError

Compatibility for Arch Linux

I'm trying to build python3 on Manjaro, which uses pacman as its package manager, Kindly add support for Manjaro and other Arch Linux distros

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.