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

Flet APK build error for psycopg2-binary Cannot_compile_native_modules #66

Open
ssaravanan384900712 opened this issue Feb 2, 2024 · 0 comments

Comments

@ssaravanan384900712
Copy link

I have created a flet app that need to run SQL Queries with psycopg (postgresql client module )


**$ cat requirements.txt**
flet
psycopg2-binary

when i do
$ flet build apk

`
VERBOSE: Building wheels for collected packages: psycopg2-binary
VERBOSE: Building wheel for psycopg2-binary (pyproject.toml): started
VERBOSE: Building wheel for psycopg2-binary (pyproject.toml): finished with status 'error'
VERBOSE: Failed to build psycopg2-binary
/tmp/hostpython3.11_TYVJJF/python/lib/python3.11/site-packages/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
error: subprocess-exited-with-error

× Building wheel for psycopg2-binary (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-311
creating build/lib.linux-x86_64-cpython-311/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-cpython-311/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-cpython-311/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-cpython-311/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-cpython-311/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-cpython-311/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-cpython-311/psycopg2
copying lib/errors.py -> build/lib.linux-x86_64-cpython-311/psycopg2
copying lib/init.py -> build/lib.linux-x86_64-cpython-311/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-cpython-311/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-cpython-311/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-cpython-311/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/psycopg
Cannot_compile_native_modules -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fdebug-default-version=4 -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -I/tools/deps/libedit/include -fPIC "-DPSYCOPG_VERSION=2.9.9 (dt dec pq3 ext lo64)" -DPSYCOPG_DEBUG=1 -DPG_VERSION_NUM=140010 -DHAVE_LO64=1 -DPSYCOPG_DEBUG=1 -I/tmp/hostpython3.11_TYVJJF/python/include/python3.11 -I. -I/usr/include/postgresql -I/usr/include/postgresql/14/server -I/usr/include/libxml2 -c psycopg/adapter_asis.c -o build/temp.linux-x86_64-cpython-311/psycopg/adapter_asis.o -Wdeclaration-after-statement

  It appears you are missing some prerequisite to build the package from source.

  You may install a binary package by installing 'psycopg2-binary' from PyPI.
  If you want to install psycopg2 from source, please install the packages
  required for the build and try again.

  For further information please check the 'doc/src/install.rst' file (also at
  <https://www.psycopg.org/docs/install.html>).

  error: command 'Cannot_compile_native_modules' failed: No such file or directory
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for psycopg2-binary
ERROR: Could not build wheels for psycopg2-binary, which is required to install pyproject.toml-based projects

[notice] A new release of pip is available: 23.2.1 -> 23.3.2
[notice] To update, run: /tmp/hostpython3.11_TYVJJF/python/bin/python3 -m pip install --upgrade pip
Deleting Flutter bootstrap directory /tmp/flet_flutter_build_JQUjPPFpcO
Error building Flet app - see the log of failed command above.
`

redis is working fine as it is a pure python module, but i need to connnct via psycopg

Please help

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

1 participant