python安装psycopg2 报错 ERROR: Command errored out with exit status 1
使用pip install psycopg2 报错如下:
Collecting psycopg2
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/84/d7/6a93c99b5ba4d4d22daa3928b983cec66df4536ca50b22ce5dcac65e4e71/psycopg2-2.8.4.tar.gz (377kB)
|████████████████████████████████| 378kB 41.4MB/s
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-YZ7EqO/psycopg2/setup.py’"’"’; file=’"’"’/tmp/pip-install-YZ7EqO/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 pip-egg-info
cwd: /tmp/pip-install-YZ7EqO/psycopg2/
Complete output (27 lines):
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: ‘project_urls’
warnings.warn(msg)
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: ‘python_requires’
warnings.warn(msg)
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file ‘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.
解决方法:
先安装postgresql-devel*
yum install postgresql-devel*
再用pip安装psycopg2 解决问题
- 点赞
- 收藏
- 分享
- 文章举报
- 解决python3.7安装turtle报错ERROR: Command errored out with exit status 1:
- python2.7 安装MYSQL-python 报错:ERROR: Command errored out with exit status 1:
- python安装第三方库遇到 ERROR: Command errored out with exit status 1:
- ubuntu18.04 python3.7 pip安装mysqlclient报错ERROR: Command errored out with exit status 1
- imgaug库安装失败:OSError: [WinError 126] 找不到指定的模块;ERROR: Command errored out with exit status 1
- 用pip下载beatifulSoup报错ERROR: Command errored out with exit status 1: python setup.py egg_info Check th
- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full
- 安装Python的psutil模块时报错:error: command 'gcc' failed with exit status 1
- 安装python-MySQLdb 出现error: command 'gcc' failed with exit status 1的解决方法
- Python Mac安装 mysqlclient 包报错“error: command 'clang' failed with exit status 1”解决办法
- mac下安装mysql-python包报unable to execute llvm-gcc-4.2: No such file or directory error: command 'llvm-gcc-4.2' failed with exit status 1解决方法
- Centos4.3安装MySQL-python-1.2.3,出现error: command 'gcc' failed with exit status 1
- 安装MySQL-python时发生错误:error: command 'gcc' failed with exit status 1
- 解决Python扩展程序编译安装的error: command 'mt.exe' failed with exit status 31
- 成功解决ERROR: Command errored out with exit status 1: command: 'f:\program files\python\python36\pyt
- 安装python模块时出现:error: Setup script exited with error: command 'gcc' failed with exit status 1
- 【宝塔面板】使用过程中遇到的问题 - ERROR: Command errored out with exit status 1解决方案
- 安装MySQL-python-1.2.3c1出现“error: command 'gcc' failed with exit status 1”错误
- CentOS7上 pip install MySQL-python 安装失败(error: command 'gcc' failed with exit status 1)的解决办法
- 安装MySQL-python报错error: command 'gcc' failed with exit status 1