从源安装Odoo:错误:找不到pg_config可执行文件

时间:2019-11-11 04:38:16

标签: python python-3.x odoo

我正在使用源代码https://github.com/odoo/odoo/tree/aa0554d224337e1d966479a351a3ed059d297765

在Windows 10(Python版)上

Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)] on win32

我发现错误

enter image description here

    ERROR: Command errored out with exit status 1:
     command: 'c:\program files (x86)\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\xxxxxxxx\\AppData\\Local\\Temp\\pip-install-e5g8ghcb\\psycopg2\\setup.py'"'"'; __file__='"'"'C:\\Users\\xxxxxxxx\\AppData\\Local\\Temp\\pip-install-e5g8ghcb\\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 'C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\pip-egg-info'
         cwd: C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\
    Complete output (23 lines):
    running egg_info
    creating C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\pip-egg-info\psycopg2.egg-info
    writing C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\pip-egg-info\psycopg2.egg-info\PKG-INFO
    writing dependency_links to C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\pip-egg-info\psycopg2.egg-info\dependency_links.txt
    writing top-level names to C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\pip-egg-info\psycopg2.egg-info\top_level.txt
    writing manifest file 'C:\Users\xxxxxxxx\AppData\Local\Temp\pip-install-e5g8ghcb\psycopg2\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.

如何解决?

1 个答案:

答案 0 :(得分:2)

  • 来自Windows Source Install

      

    警告   

    某些依赖项无法通过pip安装,需要手动安装。   特别是:

    • psycopg必须与   this installer
    • wkhtmltopdf必须安装在0.12.5版中   它支持页眉和页脚。看我们的   Wiki上的更多详细信息    各种版本。

  • 错误消息提示您:

      

    如果您不想避免从源代码构建psycopg2,请安装PyPI       而是使用“ psycopg2-binary”软件包。

  • 已发布Python 3.8的psycopg2软件包,您可以 用pip安装它:

    pip install psycopg2  
    
  • 如果要从源代码安装psycopg2,请参阅official docs