src/lxml/etree_defs.h:9:31:致命错误:libxml/xmlversion.h:没有这样的文件或目录

2024-04-10

  1. 我正在运行以下命令来安装该文件中的软件包“pip install -r requirements.txt --download-cache=~/tmp/pip-cache".

  2. requirement.txt 包含类似的包

# Data formats
# ------------
PIL==1.1.7 # 

html5lib==0.90
httplib2==0.7.4
lxml==2.3.1

# Documentation
# -------------
Sphinx==1.1
docutils==0.8.1

# Testing
# -------
behave==1.1.0
dingus==0.3.2
django-testscenarios==0.7.2
mechanize==0.2.5
mock==0.7.2
testscenarios==0.2
testtools==0.9.14
wsgi_intercept==0.5.1

在安装“lxml”包时出现以下错误

Requirement already satisfied (use --upgrade to upgrade): django-testproject>=0.1.1 in /usr/lib/python2.7/site-packages/django_testproject-0.1.1-py2.7.egg (from django-testscenarios==0.7.2->-r requirements.txt (line 33))
Installing collected packages: lxml, Sphinx, docutils, behave, dingus, mock, testscenarios, testtools, South
  Running setup.py install for lxml
    Building lxml version 2.3.1.
    Building without Cython.
    ERROR: /bin/sh: xslt-config: command not found

    ** make sure the development packages of libxml2 and libxslt are installed **

    Using build configuration of libxslt
    building 'lxml.etree' extension
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.7/src/lxml/lxml.etree.o -w
    In file included from src/lxml/lxml.etree.c:239:0:
    src/lxml/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/root/Projects/ir/build/lxml/setup.py';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-SwjFm3-record/install-record.txt:
    Building lxml version 2.3.1.

Building without Cython.

ERROR: /bin/sh: xslt-config: command not found



** make sure the development packages of libxml2 and libxslt are installed **



Using build configuration of libxslt

running install

running build

running build_py

copying src/lxml/cssselect.py -> build/lib.linux-i686-2.7/lxml

copying src/lxml/__init__.py -> build/lib.linux-i686-2.7/lxml

copying src/lxml/sax.py -> build/lib.linux-i686-2.7/lxml

copying src/lxml/pyclasslookup.py -> build/lib.linux-i686-2.7/lxml

copying src/lxml/usedoctest.py -> build/lib.linux-i686-2.7/lxml

copying src/lxml/doctestcompare.py -> build/lib.linux-i686-2.7/lxml

copying src/lxml/_elementpath.py -> build/lib.linux-i686-2.7/lxml

copying src/lxml/ElementInclude.py -> build/lib.linux-i686-2.7/lxml

copying src/lxml/builder.py -> build/lib.linux-i686-2.7/lxml

copying src/lxml/html/clean.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/__init__.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/_dictmixin.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/ElementSoup.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/usedoctest.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/defs.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/builder.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/_html5builder.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/diff.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/html5parser.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/_diffcommand.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/_setmixin.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/soupparser.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/html/formfill.py -> build/lib.linux-i686-2.7/lxml/html

copying src/lxml/isoschematron/__init__.py -> build/lib.linux-i686-2.7/lxml/isoschematron

copying src/lxml/etreepublic.pxd -> build/lib.linux-i686-2.7/lxml

copying src/lxml/tree.pxd -> build/lib.linux-i686-2.7/lxml

copying src/lxml/etree_defs.h -> build/lib.linux-i686-2.7/lxml

copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/rng

copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl

copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1

running build_ext

building 'lxml.etree' extension

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.7/src/lxml/lxml.etree.o -w

In file included from src/lxml/lxml.etree.c:239:0:

src/lxml/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: No such file or directory

compilation terminated.

error: command 'gcc' failed with exit status 1

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/root/Projects/ir/build/lxml/setup.py';execfile(__file__)" install --single-version-externally-managed --record /tmp/pip-SwjFm3-record/install-record.txt failed with error code 1
Storing complete log in /root/.pip/pip.log

任何人都可以检查并指导我会出现什么问题以及为什么?缺少安装任何软件包。


使用以下命令安装 libxslt-devel 和 libxml2-devel

sudo apt-get install libxml2-dev libxslt1-dev

安装后按照上面的操作即可

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

src/lxml/etree_defs.h:9:31:致命错误:libxml/xmlversion.h:没有这样的文件或目录 的相关文章

随机推荐

  • 临时文件 asp.net resx 文件,“已添加具有相同密钥的项目”

    几周前 我们将服务器从 NET 4 5 更新到 4 5 1 并将代码更改为作为 优化代码 运行 在即将发布的版本中 我们开始在日志中收到奇怪的错误消息 并且网站刚刚崩溃 System ArgumentException An item wi
  • php数组加载到javascript中

    所以我是个 php javascript 菜鸟 我正在尝试将完整的 php 数组加载到 javascript 数组中 我为 JavaScript 写了这个 var names new Array for var i 0 i lt 48 i
  • Java 中的非空白匹配

    我想检测其中包含非空白字符的字符串 现在我正在尝试 Pattern matches S city 但它似乎不起作用 有没有人有什么建议 我知道我可以修剪字符串并测试它是否等于空字符串 但我宁愿这样做 您认为正则表达式到底匹配什么 Try P
  • ruby - 文件私有方法

    在ruby中 有没有办法定义一个方法 该方法对文件 或模块 中的每个类都可见 但对需要该文件的文件不可见 相关 但不完全相同 我们可以重新定义一个方法 例如标准库的类中的方法 以便此重新定义仅在当前文件中可见吗 所有其他文件应查看原始定义
  • Python:检查对象是否可以原子方式pickle

    检查对象是否可以被原子腌制的准确方法是什么 当我说 原子腌制 时 我的意思是不考虑它可能引用的其他对象 例如 这个列表 l threading Lock 不是一个可腌制的对象 因为它指的是Lock这是不可腌制的 但从原子角度来看 这个列表本
  • 使用 Microsoft bot 框架下载文件(pdf/图像)

    我想下载文档 图像 文档 图像位于互联网上 我给出了它的路径 但它不起作用 但是 如果我只是评论附件部分 我就能从 BOT 那里得到 嗨 让控制器像这样 BotAuthentication public class MessagesCont
  • System.setProperty("sun.net.http.allowRestrictedHeaders", "true") 在詹金斯中不起作用

    我正在尝试在 http 请求标头中发送原始标头 但是当我获取其值时 我得到的是 null 而不是我在原始标头中设置的 url 另外 我还使用以下命令启用了受限标头作为詹金斯作业中请求标头的一部分发送 System setProperty s
  • 底图图层组的传单图层控制

    简而言之 我需要由传单图层控件控制图层组 一次两到三个 在这个JSFiddle http jsfiddle net knu2xs FH9VF 3 当更改底图时 水力叠加层需要始终保持在各种底图之上 如果您运行并使用右上角的图层控件 您会注意
  • Bash 中变量的大括号扩展

    我想在 Bash 中扩展一个变量 这是我的例子 variable 1 2 3 echo variable 预期输出 1 2 3 实际输出 1 2 3 由于 bash 执行命令行扩展的顺序 扩展不起作用 如果您阅读手册页 您会看到顺序是 支撑
  • 如何让子类自动调用父类__init__?

    我有一个名为 CacheObject 的类 许多类都从它扩展 现在我需要在该类的所有类中添加一些通用的东西 所以我写了这个 class CacheObject object def init self self updatedict dic
  • 我的应用程序中的按钮应该只获取 8 个文本字段中的文本,如果所有字段都已填写,则将其发送到表格

    我的应用程序中的一个按钮获取您在 8 个文本字段中输入的所有文本并将其发送到表格 我需要代码 以便您需要填写所有字段才能发送信息 if 语句怎么写 这是代码add info button private void jButton1Actio
  • 不使用 FindFirstFile 迭代目录中的文件

    在Windows操作系统上 如何在不使用第三方库或不使用FindFirstFile FindNextFile等的情况下迭代给定目录中的文件 鉴于 FindFirstFile 是 Windows 中主要的文件枚举方法 您还期望得到什么 有 N
  • 获取对象时如何处理“匹配查询不存在”

    当我想使用 get 函数选择对象时 例如 personalProfile World objects get ID personID 如果 get 函数未返回查找值 则 匹配的查询不存在 发生错误 如果我不需要这个错误 我将使用 try 和
  • 如何使 Google App Engine 上的 Rails 应用程序重定向到 HTTPS

    我已成功将 Rails 应用程序部署到 Google App Engine 我的域也由 Google 托管 现在我想将访问我的 http 地址的任何人重定向到我的 https 地址 我找到了针对 Python 应用程序执行此操作的文档her
  • IDataErrorInfo - 即使收到错误消息也没有看到任何错误消息

    我有 ItemType 它在 IDataErrorInfo 接口的帮助下实现了验证所需的一切 region IDataErrorInfo implementation WPF doesn t need this one public str
  • 浏览器Ctrl+F查找不可见文本

    Can the browser feature of Ctrl F to find text be integrated with text in popup windows I d like to have some scientific
  • html2canvas和toDataURL生成的图像有水平线

    我循环遍历 10 14 个 html 元素 并在数组中生成图像数据 以供稍后插入 PDF 时使用 问题是这些图像偶尔会有一条水平线穿过它们 这似乎是 html2canvas 现有的问题 主要发生在 FF 和 IE 中 偶尔在 Chrome
  • 如何在 git 中获取/重新推送子模块?

    在我的 git 存储库 Bitbucket 中 我引用了一个子项目 当我将它推到第一个位置时 包含了 git 文件夹 即使我仅使用存储库进行备份 因此并不是真正需要的 现在我有一个对该子模块的引用在存储库中
  • Java 的 C++ 解析器/模型

    我想知道是否有人知道可以在 Java 中以编程方式使用的现有 C 解析器 代码模型 我正在寻找类似于 Eclipse CDT 的东西 它可以用作 Java 的库 并且不依赖于 Eclipse 提前致谢 您不想构建自己的 C 解析器 它会杀了
  • src/lxml/etree_defs.h:9:31:致命错误:libxml/xmlversion.h:没有这样的文件或目录

    我正在运行以下命令来安装该文件中的软件包 pip install r requirements txt download cache tmp pip cache requirement txt 包含类似的包 Data formats PIL