1. 程式人生 > 其它 >【Python】ImportError: libpq.so.5: cannot open shared object file: No such file or directory

【Python】ImportError: libpq.so.5: cannot open shared object file: No such file or directory

技術標籤:PythonPostgreSQLpythonlinuxpostgresql

在引用psycopg2的時候報錯

ImportError: libpq.so.5: cannot open shared object file: No such file or directory

在這裡插入圖片描述

解決辦法:

cd /etc/ld.so.conf.d
echo "/usr/local/pgsql/lib" >>pgsql.conf
ldconfig