新配置的centos7服務器,使用pip3 install psycopg2 安裝失敗
提示:
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
原因:缺少以下環境條件
按要求安裝
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install postgresql11
yum install postgresql11-server
yum install postgresql11-libs
yum install postgresql11-contrib
yum install postgresql11-devel
配置 pg_config 路徑
export PATH=/usr/pgsql-11/bin/:$PATH
執行
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ psycopg2