簡體   English   中英

Pipenv 鎖定失敗:錯誤:找不到 pg_config 可執行文件

[英]Pipenv Locking Failed: Error: pg_config executable not found

我有一個干凈的虛擬環境,我用 pipenv 設置了它。 我需要安裝一個名為 wrds 的包,它似乎將psycopg2作為依賴項。 運行pipenv install wrds后出現此錯誤。

完整的錯誤說:

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.

所以我運行pipenv install psycopg2-binary並得到同樣的錯誤。 真的不明白這里發生了什么。 我不想從源代碼構建 psycopg2,因為我需要我的其他團隊成員能夠只運行pipenv install

編輯:剛剛發現這提供了一些有用的信息。 https://github.com/pypa/pipenv/issues/3991

我有同樣的問題,在 Mac OS 上,我使用自制程序包管理器解決了它

brew install postgresql

安裝 postgresql pipenv 后成功鎖定環境

暫無
暫無

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

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