在未安装postgresql-devel的系统中用pip安装psycopg2时报错:Error: pg_config executable not found。解决办法是:
1、如果是linux系统,则安装postgresql-devel:
sudo yum install python-devel postgresql-devel
或
sudo apt install libpq-dev
2、在windows上,下载whl包进行安装:
https://pypi.org/project/psycopg2/#files