Installation error psycopg2 termux Android

Issue

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

Answered By – Roman Smolnyk

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published