sofdigital / DroidPython

Python app development with SL4A in Android Studio
MIT License
55 stars 17 forks source link

_sqlite3.so: has text relocations #10

Open danielrosero opened 6 years ago

danielrosero commented 6 years ago

I'm trying to get Instabot running inside Android. I managed to import all the dependencies successfully, but came to this issue with _sqlite3.

So far I have tried to replace sqlite3.so with other compilations unsuccessfully.

Any change you can help?

Thanks for this project.

ux:/data/data/com.android.python27/files` # python example.py                                       
WARNING:` linker: Warning: unable to normalize ""

WARNING: linker: Warning: unable to normalize ""
WARNING: linker: Warning: unable to normalize ""
WARNING: linker: Warning: unable to normalize ""
WARNING: linker: Warning: unable to normalize ""
WARNING: linker: /data/data/com.android.python27/files/python/lib/python2.7/lib-dynload/_sqlite3.so: unused DT entry: type 0xf arg 0x1591
Traceback (most recent call last):
  File "example.py", line 6, in <module>
    from src import InstaBot
  File "/data/data/com.android.python27/files/src/__init__.py", line 1, in <module>
    from .instabot import InstaBot
  File "/data/data/com.android.python27/files/src/instabot.py", line 15, in <module>
    import sqlite3
  File "/data/data/com.android.python27/files/packages/python/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/data/data/com.android.python27/files/packages/python/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: dlopen failed: /data/data/com.android.python27/files/python/lib/python2.7/lib-dynload/_sqlite3.so: has text relocations
michaelrinderle commented 6 years ago

i've never used instabot but you can check :

danielrosero commented 6 years ago

Its the one that comes with the python_27.zip package.

El 9 mar. 2018 9:33 AM, "michael" notifications@github.com escribió:

is sqlite3.so compiled with android ndk? the binary needs to be compiled for the arm arch.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ainsophical/DROID_PYTHON/issues/10#issuecomment-371828495, or mute the thread https://github.com/notifications/unsubscribe-auth/AFbp7s3IhuXUxUr1Qnzh8DMG8DUMAJ2Sks5tcpK8gaJpZM4Sh-Vx .

michaelrinderle commented 6 years ago

okay, is there a constraint for a specific version of slqlite? is it using a specific orm? i've used sqlalchemy with sqlite & droid-python , but i can't confirm if I had to modify it at all.

danielrosero commented 6 years ago

I'm sorry, I don't understand what you are saying Michael. How do I check it out?

What I did yesterday was to try out replacing the python_27.zip and python27_extras.zip for pythonr33.zip and pythonr33_extras.zip

But still not working. Told me something of site package not found.

Thank you for helping me out Michael

El 9 mar. 2018 11:44 AM, "michael" notifications@github.com escribió:

okay, is there a constraint for a specific version of slqlite? is it using a specific orm? i've used sqlalchemy with droid-python with droid-python projects, but i can't confirm if I had to modify it at all.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ainsophical/DROID_PYTHON/issues/10#issuecomment-371867972, or mute the thread https://github.com/notifications/unsubscribe-auth/AFbp7vdq8KOh26gQnHdcsTrDzJ9QNgwFks5tcrFVgaJpZM4Sh-Vx .

michaelrinderle commented 6 years ago

NP. Yes, don't do that, just asking for more problems to figure out.

When importing a python package that is not included you have to make sure you have not only the right dependencies but it has to be a pure python package. So you have to browse the code @ https://github.com/instagrambot/instabot to see if it doesn't depend on any c libraries that are not compiled to arm as well as if there is any requirements for a specific sqlite version. I don't recall off the top of my head which version is compiled and included in this repo.

danielrosero commented 6 years ago

I see. Forgot to tell you that yesterday I did put the Instabot project to work, but unfortunately not with your droid_python project but directly installing sl4a.apk and pythonforandroid.apk and then calling the example script from the interpreter. The bot works without any problems this way, so I guess there is no problem with C modules of any kind.

I hope you can help me to solve this sqlite3 issue, one thing that I love of yours, is that the environment comes all packed up in the apk that droid_python deploys, no need for third party apps.

El 9 mar. 2018 11:57 AM, "michael" notifications@github.com escribió:

NP. Yes, don't do that, just asking for more problems to figure out.

When importing a python package that is not included you have to make sure you have not only the right dependency but it has to be a pure python package. So you have to browse the code @ https://github.com/ instagrambot/instabot to see if it doesn't depend on any c libraries that are not compiled to arm as well as if there is any requirements for a specific sqlite version. I don't recall off the top of my head which version is compiled and included in this repo.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ainsophical/DROID_PYTHON/issues/10#issuecomment-371872742, or mute the thread https://github.com/notifications/unsubscribe-auth/AFbp7vgDYJhH75U_COW5Z5Zbb9neZJHRks5tcrRjgaJpZM4Sh-Vx .

michaelrinderle commented 6 years ago

No doubt. If you hybrid it into a webview / python backend server app, the performance is terrific on android. Ahh! Sorry, its been awhile; if you are deploying to an emulator, you need an ARM version, too. Unfortunately, I write all my apps in c#\xamarin so I have little interest in this project anymore.

Email me your email address and I'll pass you my current pymod & py27 zip files for you to try if you keep hitting a roadblock; michael@sofdigital.net