centos sentry ERROR: Could not build wheels for xmlsec, which is required to install pypro

问题描述
在安装sentry包时,系统出现如下报错信息:

Building wheels for collected packages: xmlsec
  Building wheel for xmlsec (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /root/.virtualenvs/sentryenv/bin/python /root/.virtualenvs/sentryenv/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpMPk1Y6
       cwd: /tmp/pip-install-vXibQv/xmlsec
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_py
  package init file 'src/xmlsec/__init__.py' not found (or not a regular file)
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/xmlsec
  copying src/xmlsec/py.typed -> build/lib.linux-x86_64-2.7/xmlsec
  copying src/xmlsec/constants.pyi -> build/lib.linux-x86_64-2.7/xmlsec
  copying src/xmlsec/template.pyi -> build/lib.linux-x86_64-2.7/xmlsec
  copying src/xmlsec/__init__.pyi -> build/lib.linux-x86_64-2.7/xmlsec
  copying src/xmlsec/tree.pyi -> build/lib.linux-x86_64-2.7/xmlsec
  running build_ext
  error: xmlsec1 is not installed or not in path.
  ----------------------------------------
  ERROR: Failed building wheel for xmlsec
Failed to build xmlsec
ERROR: Could not build wheels for xmlsec which use PEP 517 and cannot be installed directly

问题分析
错误指出不能通过轮子的方式直接安装xmlsec模块。查找相关错误,没有具体的,但是借鉴’ERROR: Could not build wheels for bottleneck which use PEP 517 and cannot be installed directly’ #281
这一类似问题可以明确是在安装xmlsec模块上除了问题。所以尝试重新安装xmlsec模块

解决办法
直接通过pip进行xmlsec模块的安装,报错。所以查询了pypi-xmlsec库,可以看到在pip安装前,该模块针对不同的操作系统还会有相关的依赖。

先安装相关依赖文件:

Linux (Debian)

apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl

Note: There is no required version of LibXML2 for Ubuntu Precise, so you need to download and install it manually.

wget http://xmlsoft.org/sources/libxml2-2.9.1.tar.gz
tar -xvf libxml2-2.9.1.tar.gz
cd libxml2-2.9.1
./configure && make && make install

Linux (CentOS)

yum install libxml2-devel xmlsec1-devel xmlsec1-openssl-devel libtool-ltdl-devel

Linux (Fedora)

dnf install libxml2-devel xmlsec1-devel xmlsec1-openssl-devel libtool-ltdl-devel

Mac

brew install libxml2 libxmlsec1 pkg-config

Alpine

apk add build-base libressl libffi-dev libressl-dev libxslt-dev libxml2-dev xmlsec-dev xmlsec

再使用pip install 命令安装
Install
xmlsec is available on PyPI:

pip install xmlsec
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值