Search code examples
androidpython-3.xpsycopg2termux

Installation error psycopg2 termux Android


How can I install psycopg2 on my termux Android?

I tried

pip install psycopg2==2.2
pip3 install psycopg2-binary

LDFLAGS="-L/system/lib64/" CFLAGS="-I/data/data/com.termux/files/usr/include/" pip install psycopg2-binary

But everytime got this error Error:

Read other answers on stack overflow but they don't work.

apt-get
sudo

Commands Requires rooted Android and I'm not rooted.

I would be grateful if someone help me


Solution

  • Install PostgreSQL itself before installing python client

    pkg install postgresql

    If it doesn't help, try to install dev version and other dependencies

    pkg install postgresql-dev python make clang

    After that install postgresql client pip3 install psycopg2

    Found working solution here: https://github.com/termux/termux-packages/issues/835