解决 msys2: pip install lxml error

以下为主要报错信息:

pipe -march=x86-64 -mtune=generic -O2 -pipe -march=x86-64 -mtune=generic -O2 -pipe -DCYTHON_CLINE_IN_TRACEBACK=0 -I/usr/include/libxml2 -Isrc -Isrc/lxml/includes -I/usr/include/python3.7m -c src/lxml/etree.c -o build/temp.msys-2.11.2-x86_64-3.7/src/lxml/etree.o -w
    In file included from src/lxml/etree.c:97:0:
    /usr/include/python3.7m/Python.h:39:10: 致命错误:crypt.h:No such file or directory
     #include <crypt.h>
              ^~~~~~~~~
    编译中断。
    Compile failed: command 'x86_64-pc-msys-gcc' failed with exit status 1
    cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInit180_fx8u.c -o tmp/xmlXPathInit180_fx8u.o
    /tmp/xmlXPathInit180_fx8u.c:2:1: 警告:返回类型默认为‘int’ [-Wimplicit-int]
     main (int argc, char **argv) {
     ^~~~
    cc tmp/xmlXPathInit180_fx8u.o -L/usr/lib -lxml2 -o a.out.exe
    error: command 'x86_64-pc-msys-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-bm_34mnt/lxml/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-record-hm2wlbog/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-bm_34mnt/lxml/

根据报错信息主要是由于第一个链接库未安装导致的出错:

根据报错信息主要是由于第一个链接库未安装导致的出错:
pacman -S libcrypt-devel


如果还是出错,也许你还有下面两个需要安装
pacman -S libxslt-devel
pacman -S libxml2-devel

更多问题可以留言。

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值