【问题标题】:Python pip cannot install zbarlight: error: command 'gcc' failed with exit status 1Python pip 无法安装 zbarlight:错误:命令“gcc”失败,退出状态为 1
【发布时间】:2017-10-05 03:55:18
【问题描述】:

首先我安装了 Python 3.5.1:

yum -y install zbar gcc gcc-c++ kernel-devel
./configure --enable-shared --prefix=/usr/local LDFLAGS="-Wl,--rpath=/usr/local/lib"
make && make install

尝试安装 zbarlight pypi 包但失败:

    src/zbarlight/_zbarlight.c:137: error: ‘ZBAR_QRCODE’ undeclared (first use in this function)
    src/zbarlight/_zbarlight.c:138: error: ‘ZBAR_CODE128’ undeclared (first use in this function)
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/local/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ur77y560/zbarlight/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-hoalto9f-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ur77y560/zbarlight/

我该如何解决这个问题?我尝试了 pip3.5 -v 但没有显示任何更有意义的错误。

【问题讨论】:

    标签: python pip python-3.5 zbar


    【解决方案1】:

    必须安装

    yum install zbar-devel
    

    【讨论】:

      猜你喜欢
      • 2016-11-01
      • 2014-09-03
      • 2011-11-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-21
      • 2018-09-30
      相关资源
      最近更新 更多