when I try to install it via pip, or easy_install, it gives me error:
OSError: [Errno 2] No such file or directory: '/usr/include/pgsql/server'
How should I do this correctly?
when I try to install it via pip, or easy_install, it gives me error:
OSError: [Errno 2] No such file or directory: '/usr/include/pgsql/server'
How should I do this correctly?
You don't have the PostgreSQL server include files or they are not located at the expected path on your system. See PyGreSQL Installation for more details on PyGreSQL compilation.
For example, on Ubuntu, you need to install postgresql-server-dev-all package to have server include files. On Fedora, it's postgresql-devel.
Usually, pip will then use pg_config to find the correct path for these files.
Based on your error, pg_config has returned
'/usr/include/pgsql/server'
as the location of server header files but they have not been installed on your system.