日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【pip install psycopg2安装报错】Error: pg_config executable not found.

發(fā)布時(shí)間:2025/3/19 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【pip install psycopg2安装报错】Error: pg_config executable not found. 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

背景

在pip install?psycopg2-binary 的時(shí)候報(bào)錯(cuò)了。錯(cuò)誤內(nèi)容如下。

Collecting psycopg2-binaryUsing cached psycopg2-binary-2.8.6.tar.gz (384 kB)ERROR: Command errored out with exit status 1:command: 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bkabu6av/psycopg2-binary/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bkabu6av/psycopg2-binary/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 /tmp/pip-pip-egg-info-ez6k71_8scwd: /tmp/pip-install-bkabu6av/psycopg2-binary/Complete output (23 lines):running egg_infocreating /tmp/pip-pip-egg-info-ez6k71_8/psycopg2_binary.egg-infowriting /tmp/pip-pip-egg-info-ez6k71_8/psycopg2_binary.egg-info/PKG-INFOwriting dependency_links to /tmp/pip-pip-egg-info-ez6k71_8/psycopg2_binary.egg-info/dependency_links.txtwriting top-level names to /tmp/pip-pip-egg-info-ez6k71_8/psycopg2_binary.egg-info/top_level.txtwriting manifest file '/tmp/pip-pip-egg-info-ez6k71_8/psycopg2_binary.egg-info/SOURCES.txt'Error: pg_config executable not found.pg_config is required to build psycopg2 from source. Please add the directorycontaining pg_config to the $PATH or specify the full executable path with theoption: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<https://www.psycopg.org/docs/install.html>).---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

原因分析

從報(bào)錯(cuò)的提示來看,是系統(tǒng)不知道pg_config的路徑,需要把這個(gè)路徑添加到PATH當(dāng)中。但我們并不能找到這個(gè)路徑在哪。那么我們就前往官網(wǎng)看看

?

但我的系統(tǒng)里面并不能找到這個(gè)包。而是另外一個(gè)包? ?postgresql-devel

?

解決辦法

yum install postgresql-devel

?

總結(jié)

以上是生活随笔為你收集整理的【pip install psycopg2安装报错】Error: pg_config executable not found.的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。