[英]Failure to install psycopg2 in Pycharm
我正在嘗試安裝 psycopg2 以在我的 django 項目的后端使用 postgresql 數據庫,但每次運行pip install psycopg2
命令時,我都會收到一條錯誤消息:
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'.
我已將包含該文件的 \bin\ 文件夾添加到我的路徑中,我也運行了pip install psycopg2-binary
命令,並且在我的計算機上卸載並重新安裝了 posgresql,我還運行了python setup.py build_ext
命令在錯誤消息中提到,仍然彈出此錯誤。 我在 windows 10 操作系統上運行並使用 posgresql 13.1。 有什么建議么?
編輯:這是我在終端中遇到的錯誤:
你可能已經這樣做了,但步驟應該是:
bin/
文件夾添加到您的路徑。pip install psycopg2
我在這里全新安裝了 Windows 10,它似乎對我有用。 運行pip install psycopg2-binary
應該絕對有效(即使沒有 PostgreSQL),因為它不會編譯任何東西,所以如果你在那里也有錯誤,我很感興趣。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.