【pip install psycopg2安装报错】Error: pg_config executable not found.
生活随笔
收集整理的這篇文章主要介紹了
【pip install psycopg2安装报错】Error: pg_config executable not found.
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
背景
在pip install?psycopg2-binary 的時候報錯了。錯誤內(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.原因分析
從報錯的提示來看,是系統(tǒng)不知道pg_config的路徑,需要把這個路徑添加到PATH當中。但我們并不能找到這個路徑在哪。那么我們就前往官網(wǎng)看看
?
但我的系統(tǒng)里面并不能找到這個包。而是另外一個包? ?postgresql-devel
?
解決辦法
yum install postgresql-devel?
總結(jié)
以上是生活随笔為你收集整理的【pip install psycopg2安装报错】Error: pg_config executable not found.的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【解决pip install 安装报错】
- 下一篇: 解决Keepalived脚本启动时war