在安装psycopg2时发生错误
Error: pg_config executable not found.
需要安装2个库
执行语句
sudo apt-get install python-psycopg2,libpq-dev
结果:
pi@raspberrypi3:~ $ pip3.9 install psycopg2
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://mirrors.aliyun.com/pypi/simple, https://www.piwheels.org/simple
Collecting psycopg2
Using cached https://mirrors.aliyun.com/pypi/packages/a8/8f/1c5690eebf148d1d1554fc00ccf9101e134636553dbb75bdfef4f85d7647/psycopg2-2.8.5.tar.gz (380 kB)
Using legacy setup.py install for psycopg2, since package 'wheel' is not installed.
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... done
Successfully installed psycopg2-2.8.5