I installed psycopg2 to pypy3(Python3.5.3) by the following code on Ubuntu16.04:
pypy3 -m pip install psycopg2
However, I got some errors:
Error:b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-epd368s6/psycopg2
And I found the solution in "You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application".
My computer has already installed Postgresql9.5, so I used these commands to install:
sudo apt-get install libpq-dev
pypy3 -m pip install psycopg2
No error was reported, but when I tried "import psycopg2", I got ImportError:
I found the same error in "pypy3 import psycopg2 error (PyCodec_Encoder)", but I did not found a solution.
Do someone know how to fix it?