-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Psycopg2 error after the apk installation. #1711
Comments
Usually you should share as much info as possible. e.g. your |
I could reproduce the issue, after extracting the APK it turns out that |
I extracted the APK and inside the lib directory (the "site-packages" directory do not exist) I could note that all the libraries where packaged, except the psycopg2. I'm using python 3 to run my app, it could be a problem? |
You need to extract two things, first unzip the |
Yes it's because the path is wrong, see it says |
Ok, so to fix it I have to edit the init.py, inside the psycopg2 recipe directory. I tried to edit it to: P.S: After every change I made I ran the |
Great yes that new error is way better! |
Digging into it things feel more clear, it actually is a "feature" of the Android NDK. #if __ANDROID_API__ >= 26
char* nl_langinfo(nl_item __item) __INTRODUCED_IN(26);
char* nl_langinfo_l(nl_item __item, locale_t __l) __INTRODUCED_IN(26);
#endif /* __ANDROID_API__ >= 26 */ So basically the header is available and will work at compile time, but the definition is not available if your |
I gave it a try and it worked. I compiled from Docker with: python setup_testapp_psycopg2.py apk --sdk-dir $ANDROID_SDK_HOME --ndk-dir $ANDROID_NDK_HOME --ndk-api 26 --bootstrap sdl2 --requirements python3,kivy,psycopg2 I used the following from distutils.core import setup
from setuptools import find_packages
options = {'apk': {'requirements': 'python3,sdl2,kivy,psycopg2',
'android-api': 27,
'ndk-api': 21,
'dist-name': 'bdisttest_python3_psycopg2',
'ndk-version': '10.3.2',
'permission': 'VIBRATE',
}}
package_data = {'': ['*.py',
'*.png']
}
packages = find_packages()
print('packages are', packages)
setup(
name='testapp_python3_psycopg2',
version='1.1',
description='p4a setup.py test',
author='Alexander Taylor',
author_email='alexanderjohntaylor@gmail.com',
packages=find_packages(),
options=options,
package_data={'testapp': ['*.py', '*.png']}
) And the following print('main.py was successfully called')
print('importing psycopg2')
import psycopg2
print('psycopg2: {}'.format(psycopg2))
print('psycopg2.__version__: {}'.format(psycopg2.__version__))
print('psycopg2._psycopg: {}'.format(psycopg2._psycopg))
print('DONE!') See below relevant part of the
There's a PR ready here #1723 |
The problem is: I need to install this app in a device that has an I'm reading about and seems that the problem is inside the _psycopg.so file. The point is: how do I acess the code inside this .so file? |
The |
So I need to change this configure.ac from cpython, trying to eliminate the langinfo.h references and try to compile ? Edit: I found the configure.ac file into my VM. Now I need to found a command that makes the autoconf ignore the langinfo.h? |
…pg2_compile Fixes psycopg2 lib install dir, closes #1711
I got this error while debugging the android apk. I associate this to Buildozer because I specified into the buildozer.spec requirements the psycopg2 library. It means that is not working.
How do I fix it? I know that is a recipe for psycopg2 here: https://github.com/kivy/python-for-android/blob/master/pythonforandroid/recipes/psycopg2/__init__.py
How can I add this recipe to my project, to buildozer compile it successfully ?
The text was updated successfully, but these errors were encountered: