ImportError: dlopen failed: has bad ELF magic

Question:

ImportError: dlopen failed: "/data/python/lib/python2.7/_io.so" has bad ELF magic 

Background: I am working on some built-in apros that support the python interpreter. I have to use this apk to run some test cases that abd are placed in / sdcards / scripts / XXXX (in the same place where the python files / packages are). Now, when you run test cases, the io module is imported, which calls the _io.so module. This _io.so module is not in python, which is the default apk. So I thought that I would find the _io.so file on my mac and do adb push in / data / python / lib / python 2.7 / lib-dynload where all the other .so files are located. I thought that clicking the _io.so file at this location would solve the problem, but it is not. Can someone give me an idea of ​​what is happening and what is the main reason for this problem to be solved.

 root@condor _umts:/data/python/lib/python2.7/lib-dynload # ls -l -rw------- root root 53660 2014-05-30 12:12 _bisect.so -rw------- root root 180956 2014-05-30 12:12 _codecs_cn.so -rw------- root root 191196 2014-05-30 12:12 _codecs_hk.so -rw------- root root 81064 2014-05-30 12:12 _codecs_iso2022.so -rw------- root root 285092 2014-05-30 12:12 _codecs_jp.so -rw------- root root 175016 2014-05-30 12:12 _codecs_kr.so -rw------- root root 145036 2014-05-30 12:12 _codecs_tw.so -rw------- root root 96396 2014-05-30 12:12 _collections.so -rw------- root root 86588 2014-05-30 12:12 _csv.so 

Truncated for short ENV:

 Python 2.7.3 (default, Apr 15 2014, 13:44:15) [GCC 4.6 20120106 (prerelease)] on linux-armv7l 
+6
source share
1 answer

you cannot use the mac-x86 file for android (linux-arm supported).

+2
source

Source: https://habr.com/ru/post/970108/


All Articles