无法安装 psycopg2-binary



我试图安装psycopg2-binary (pip3安装psycopg2-binary)在虚拟环境中我的Django项目在Centos 7预装Postgresql 12和有众所周知的错误:

Error: pg_config executable not found.

pg_config is required to build psycopg2 from source.  Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:

python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.

我试图安装python3-devel postgresql-libs postgresql-server postgresql-devel postgresql-contrib,但仍然有这个错误。

pip3 install psycopg2, PIP install psycopg2 -同样的问题

PS问题已经通过更新pip解决了(pip install—upgrade pip)。

你可以试试这个方法,非常有用

sudo apt-get install postgresql postgresql-dev python-dev

相关内容

  • 没有找到相关文章

最新更新