Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MacOS中Python(Django)pip安装psycopg2错误_Python_Django_Postgresql_Psycopg2 - Fatal编程技术网

MacOS中Python(Django)pip安装psycopg2错误

MacOS中Python(Django)pip安装psycopg2错误,python,django,postgresql,psycopg2,Python,Django,Postgresql,Psycopg2,我为我的项目设置了VirtualNV,并在我想要运行时设置 brew install postgresql pip安装psycopg2 brew install postgresql 下面有个错误 ERROR: Complete output from command python setup.py egg_info: ERROR: running egg_info creating pip-egg-info/psycopg2.egg-info writing pip-egg-info/ps

我为我的项目设置了VirtualNV,并在我想要运行时设置

brew install postgresql
pip安装psycopg2

brew install postgresql
下面有个错误

ERROR: Complete output from command python setup.py egg_info:
ERROR: running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

Error: pg_config executable not found.

pg_config is required to build psycopg2 from the 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.

For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/r5/mt37g42j2h3b676lpx3qlznm0000gn/T/pip-install-yijundiy/psycopg2/
brew install postgresql
另外,当我使用这个命令时

brew install postgresql
sudo python setup.py安装

brew install postgresql
我也有这样的错误:

(null): can't open file 'setup.py': [Errno 2] No such file or directory
brew install postgresql

我该怎么办

我想你没有安装Postgres,你可以使用

brew install postgresql

这有助于解决你的问题。之后,您可以安装pip依赖项软件包

我认为您没有安装Postgres,您可以使用

brew install postgresql

这有助于解决你的问题。之后,您可以安装pip依赖项软件包,并获得一个独立的软件包

brew install postgresql

运行
pip安装psycopg2二进制文件

获取一个独立的软件包

brew install postgresql

运行
pip install psycopg2 binary

可能重复的可能重复我已经这样做了,但是在运行setup.py install for psycopg2之后,我遇到了这个错误。。。错误嘿,你可以尝试使用此report并从中生成此brew安装吗?他们也可以按照此操作,我已经完成了此操作,但在运行setup.py install for psycopg2之后,我遇到了此错误。。。错误嘿,你能试着用这个reporty来构建这个brew安装吗
brew install postgresql