Skip to content
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

Kivy/Buildozer/Psycopg2 #1144

Closed
RPANISSET opened this issue Oct 19, 2017 · 9 comments
Closed

Kivy/Buildozer/Psycopg2 #1144

RPANISSET opened this issue Oct 19, 2017 · 9 comments
Milestone

Comments

@RPANISSET
Copy link

I've developed an application that uses the postgresql database, I use the PSYCOPG2 module to make the connection.
Now when I was generating the APP for Android through BUILDOZER it gives an error and they are telling me that PSYCOPG2 does not work with BUILDOZER, is that it?
How should I proceed then?

Thank's

Rogério

@RPANISSET
Copy link
Author

RPANISSET commented Oct 19, 2017

Following is the log after the buildozer android debug deploy run

Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian 'dpkg' package management program version 1.18.4 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /usr/local/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool
# Install platform
# Run 'pip install -q --user "appdirs" "colorama>=0.3.3" "sh>=1.10,<1.12.5" "jinja2" "six"'
# Cwd None
# Apache ANT found at /home/kivy/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/kivy/.buildozer/android/platform/android-sdk-23
# Android NDK found at /home/kivy/.buildozer/android/platform/android-ndk-r9c
# Check application requirements
# Check garden requirements
# Compile platform
# Using custom source dirs:
    P4A_kivymd_DIR = /home/kivy
# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=cidadeApp --bootstrap=sdl2 --requirements=kivy==master,git+https://gitlab.com/kivymd/KivyMD.git,hostpython2,psycopg2 --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/kivy/Desktop/Cidade/.buildozer/android/platform/build'
# Cwd /home/kivy/Desktop/Cidade/.buildozer/android/platform/python-for-android-master
[0m
           working: Python-2.7.2.tar.bz2                                       [0m
                                                                               
[0m
           working: SDL2_image-2.0.1.tar.gz                                    [0m
                                                                               
[0m
           working: SDL2_mixer-2.0.1.tar.gz                                    [0m
                                                                               
[0m
           working: SDL2_ttf-2.0.14.tar.gz                                     [0m
                                                                               
[0m
           working: Python-2.7.2.tar.bz2                                       [0m
                                                                               
[0m
           working: postgresql-9.5.3.tar.bz2                                   [0m
                                                                               
[0m
           working: SDL2-2.0.4.tar.gz                                          [0m
                                                                               
[0m
           working: six-1.9.0.tar.gz                                           [0m
                                                                               
[0m
           working: psycopg2-latest.tar.gz                                     [0m
                                                                               
[0m
           working: master.zip                                                 [0m
                                                                               
[0m
           working: master.zip                                                 [0m
                                                                               
[0m
           working: Python-2.7.2.tar.bz2                                       [0m
                                                                               
[0m
           working: SDL2_image-2.0.1.tar.gz                                    [0m
                                                                               
[0m
           working: SDL2_mixer-2.0.1.tar.gz                                    [0m
                                                                               
[0m
           working: SDL2_ttf-2.0.14.tar.gz                                     [0m
                                                                               
[0m
           working: Python-2.7.2.tar.bz2                                       [0m
                                                                               
[0m
           working: postgresql-9.5.3.tar.bz2                                   [0m
                                                                               
[0m
           working: SDL2-2.0.4.tar.gz                                          [0m
                                                                               
[0m
           working: six-1.9.0.tar.gz                                           [0m
                                                                               
[0m
           working: psycopg2-latest.tar.gz                                     [0m
                                                                               
[0m
           working: master.zip                                                 [0m
                                                                               
[0m
           working: master.zip                                                 [0m
                                                                               
[0m
           working: Android NDK: WARNING:/home/kivy/Desktop/C...(and 150 more) [0m
           working: Android NDK:     This is likely to result ...(and 53 more) [0m
           working: Android NDK:     or LOCAL_SHARED_LIBRARIES...(and 48 more) [0m
           working: Android NDK:     current module                            [0m
           working: rm -f /home/kivy/Desktop/Cidade/.buildoze...(and 429 more) [0m
           working: rm -f /home/kivy/Desktop/Cidade/.buildoze...(and 437 more) [0m
           working: rm -f /home/kivy/Desktop/Cidade/.buildoze...(and 437 more) [0m
           working: [armeabi-v7a] Install        : libSDL2.so ...(and 30 more) [0m
           working: install -p /home/kivy/Desktop/Cidade/.bui...(and 222 more) [0m
           working: /home/kivy/.buildozer/android/platform/an...(and 246 more) [0m
           working: [armeabi-v7a] Install        : libSDL2_ima...(and 42 more) [0m
           working: install -p /home/kivy/Desktop/Cidade/.bui...(and 234 more) [0m
           working: /home/kivy/.buildozer/android/platform/an...(and 252 more) [0m
           working: [armeabi-v7a] Install        : libSDL2_mix...(and 42 more) [0m
           working: install -p /home/kivy/Desktop/Cidade/.bui...(and 234 more) [0m
           working: /home/kivy/.buildozer/android/platform/an...(and 252 more) [0m
           working: [armeabi-v7a] Install        : libSDL2_ttf...(and 38 more) [0m
           working: install -p /home/kivy/Desktop/Cidade/.bui...(and 230 more) [0m
           working: /home/kivy/.buildozer/android/platform/an...(and 250 more) [0m
           working: [armeabi-v7a] Install        : libmain.so ...(and 30 more) [0m
           working: install -p /home/kivy/Desktop/Cidade/.bui...(and 222 more) [0m
           working: /home/kivy/.buildozer/android/platform/an...(and 246 more) [0m
                                                                               
[0m
           working: running build_ext                                          [0m
           working: Error: pg_config executable not found.                     [0m
           working: Please add the directory containing pg_config to the PATH  [0m
           working: or specify the full executable path with the option:       [0m
           working:     python setup.py build_ext --pg-config ...(and 28 more) [0m
           working: or with the pg_config option in 'setup.cfg'.               [0m
                                                                               
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=cidadeApp --bootstrap=sdl2 --requirements=kivy==master,git+https://gitlab.com/kivymd/KivyMD.git,hostpython2,psycopg2 --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/kivy/Desktop/Cidade/.buildozer/android/platform/build
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

@inclement inclement added this to the 0.7 milestone Nov 18, 2017
@inclement
Copy link
Member

Closing as stale, psycopg needs a recipe to work.

@AndreMiras
Copy link
Member

@ghost
Copy link

ghost commented Feb 14, 2019

@AndreMiras how do I add this recipe to my package?

@AndreMiras
Copy link
Member

Usually you just need to add it to you requirements list

@ghost
Copy link

ghost commented Feb 14, 2019

image
Well, I'm compiling with buildozer, and my app is returning this error to me. Seems that the .spec file, where I specified the requirements, and obviously psycopg2, isn't packing the library to my APK

@AndreMiras
Copy link
Member

It's not the same issue as this one above. The original issue was about psycopg2 not even compiling.
For you it's a runtime issue

@Delivery-Klad
Copy link

Usually you just need to add it to you requirements list

how can I do this?

@lawchin
Copy link

lawchin commented Oct 14, 2022

just paste it inside the buildozer spec look at line 40:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants