首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Centos无法安装PyGreSql

Centos无法安装PyGreSql
EN

Stack Overflow用户
提问于 2018-12-13 03:55:34
回答 1查看 653关注 0票数 1

为了在Centos上安装PyGreSql,我正在执行以下操作:

代码语言:javascript
复制
sudo pip3 install pygresql

但我得到以下错误:

代码语言:javascript
复制
Collecting PyGreSQL
  Using cached https://files.pythonhosted.org/packages/4a/65/03b1cd9b6daaa4e32ee72dd5fb1a01fbb7cd0dfe5439e34af6caa6ec60dc/PyGreSQL-5.0.6.tar.gz
Building wheels for collected packages: PyGreSQL
  Running setup.py bdist_wheel for PyGreSQL
  Complete output from command /usr/local/bin/python3.5 -c "import setuptools;__file__='/tmp/pip-build-scnuzepv/PyGreSQL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp0zf45j54pip-wheel-:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.5
  copying pg.py -> build/lib.linux-x86_64-3.5
  copying pgdb.py -> build/lib.linux-x86_64-3.5
  running build_ext
  building '_pg' extension
  creating build/temp.linux-x86_64-3.5
  gcc -pthread -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPYGRESQL_VERSION=5.0.6 -DDIRECT_ACCESS -DLARGE_OBJECTS -DDEFAULT_VARS -DESCAPING_FUNCS -I/usr/local/include/python3.5m -I/usr/include -I/usr/local/include/python3.5m -c pgmodule.c -o build/temp.linux-x86_64-3.5/pgmodule.o -O2 -funsigned-char -Wall -Werror
  cc1: warnings being treated as errors
  pgmodule.c: In function ‘get_type’:
  pgmodule.c:261: error: will never be executed
  pgmodule.c: In function ‘connGetCastHook’:
  pgmodule.c:3261: error: will never be executed
  pgmodule.c: In function ‘connGetNoticeReceiver’:
  pgmodule.c:3307: error: will never be executed
  pgmodule.c: In function ‘pgGetJsondecode’:
  pgmodule.c:5428: error: will never be executed
  pgmodule.c: In function ‘connInsertTable’:
  pgmodule.c:2618: error: will never be executed
  pgmodule.c:2593: error: will never be executed
  pgmodule.c: In function ‘connQuery’:
  pgmodule.c:2242: error: will never be executed
  pgmodule.c: In function ‘get_col_types’:
  pgmodule.c:371: error: will never be executed
  pgmodule.c: In function ‘cast_sized_simple’:
  pgmodule.c:497: error: will never be executed
  pgmodule.c:476: error: will never be executed
  pgmodule.c:484: error: will never be executed
  pgmodule.c: In function ‘cast_unsized_simple’:
  pgmodule.c:576: error: will never be executed
  pgmodule.c: In function ‘cast_array’:
  pgmodule.c:649: error: will never be executed
  pgmodule.c:3525: error: will never be executed
  pgmodule.c:3492: error: will never be executed
  pgmodule.c: In function ‘sourcePutData’:
  pgmodule.c:4007: error: will never be executed
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for PyGreSQL

有人能告诉我怎么解决这个问题吗?我已经在互联网上搜索了很多,但没有找到适合我的解决方案。

EN

回答 1

Stack Overflow用户

发布于 2018-12-14 21:14:55

下面是我如何在CentOS 7上安装Python3.6,Pip和PyGreSQL 5.0.6的方法:

代码语言:javascript
复制
yum install epel-release 
yum install python36 python36-devel postgresql-libs postgresql-devel
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python36 get-pip.py
pip3 install pygresql

这些命令运行得很流畅,没有任何错误。

在任何情况下,都有必要在编译PyGreSQL之前安装Postgres和Python的devel包。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53750450

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档