簡體   English   中英

從源安裝 Odoo:錯誤:找不到 pg_config 可執行文件

[英]Install Odoo from sourcce: Error: pg_config executable not found

我正在使用源代碼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

我發現錯誤

在此處輸入圖像描述

    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.

如何解決?

  • Windows 源安裝

    警告

    部分依賴無法通過 pip 安裝,需要手動安裝。 尤其是:

    • 必須使用此安裝程序安裝psycopg
    • wkhtmltopdf必須安裝在 0.12.5 版本中才能支持頁眉和頁腳。 有關各種版本的更多詳細信息,請參閱我們的 wiki。

  • 正如錯誤消息向您建議的那樣:

    如果您不想從源代碼構建 psycopg2,請改為安裝 PyPI 'psycopg2-binary' package。

  • 用於 Python 3.8 的psycopg2 package 已發布,您可以使用 pip 安裝它:

     pip install psycopg2
  • 如果要從源代碼安裝 psycopg2,請參閱官方文檔

讓我試着幫忙。

如果您將psycopg2作為要求安裝,請跳過它並在所有要求之后安裝它並單獨安裝。

sudo apt install libpq-dev python3-dev

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM