python的postgres客户端:psycopg2 [关闭]

问题描述 投票:-3回答:1

在为postgres安装psycopg2时出现错误,有人可以帮助我理解该错误并通过PIP安装psycopg2。

Using cached https://files.pythonhosted.org/packages/84/d7/6a93c99b5ba4d4d22daa3928b983cec66df4536ca50b22ce5dcac65e4e71/psycopg2-2.8.4.tar.gz
    ERROR: Command errored out with exit status 1:
     command: /Users/shrek/opt/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kz/vxlwfyzd6jj12mtclgpjv3y80000gn/T/pip-install-3sm07rvz/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/kz/vxlwfyzd6jj12mtclgpjv3y80000gn/T/pip-install-3sm07rvz/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /private/var/folders/kz/vxlwfyzd6jj12mtclgpjv3y80000gn/T/pip-install-3sm07rvz/psycopg2/
    Complete output (23 lines):
    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 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 errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
python postgresql pip
1个回答
1
投票

Postgres是与其他任何关系数据库(MySQL,MSSQL,Oracle)一样的关系数据库。从一开始,它就只有一个ORDBMS功能-table inheritance。在学术时代,Postgres是实验数据库,有关Stonebraker教授的人们也进行了有关将OOP与RDBMS混合的相同实验。但是那是30年前。此功能在30年内并未得到增强,并且存在很多局限性,通常不建议使用此功能(如果您不太清楚该怎么做)。

过去30年,Postgres的开发和发展都像经典的关系数据库系统一样。与其他数据库相比,Postgres可以通过扩展来进行增强-扩展可以携带新的类型,新的功能,新的运算符,新的监视可能性,新的索引。它也是学术时代的遗产,但不是面向对象的功能。

© www.soinside.com 2019 - 2024. All rights reserved.