这个错误可能是因为缺少PGSQL的相关库吧。
网上有很多解决办法,我最终用以下方式解决:
yum install postgresql postgresql-devel python-devel
参考博客:https://www.cnblogs.com/aguncn/p/5776896.html