从源安装Odoo:错误:找不到pg\u config可执行文件

2024-10-02 06:37:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是源代码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.

如何修复?你知道吗


Tags: installpipthetoinfoconfigegglocal
1条回答
网友
1楼 · 发布于 2024-10-02 06:37:04
  • Windows Source Install

    Warning

    Some dependencies cannot be installed through pip and require to be installed manually. In particular:

    • psycopg must be installed with this installer.
    • wkhtmltopdf must be installed in version 0.12.5 for it to support headers and footers. See our wiki for more details on the various versions.
  • 如错误消息所示:

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

  • python3.8的psycopg2包已经发布,您可以 用pip安装:

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

相关问题 更多 >

    热门问题