无法在python3上安装psycopg2

2024-05-15 11:25:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试在CentOS Linux 7上的python3上安装psycopg2模块,并出现以下错误

In file included from psycopg/psycopgmodule.c:28:0:
./psycopg/psycopg.h:36:22: fatal error: libpq-fe.h: No such file or directory
 #include <libpq-fe.h>
                      ^
compilation terminated.

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 'gcc' failed with exit status 1

有什么办法可以解决吗

谢谢


Tags: installthetofrombuildyoupackagesource