错误:未知的分发选项:'bugtrack_url'

时间:2015-04-04 01:15:20

标签: python python-2.7 virtualenv lxml

我在虚拟环境中安装odoo系统。我在安装lxml模块时遇到问题。

我正在使用“pip --trusted-host pypi.python.org install lxml”命令,但是收到错误。我试图下载源,但发生相同的错误。我在Linux下使用Python 2.7.9:

(odoo)odoo@des [~]# python -V
Python 2.7.9
(odoo)odoo@des [~]# uname -a
Linux des.desytec.com 2.6.32-042stab104.1 #1 SMP Thu Jan 29 12:58:41 MSK 2015 x86_64 x86_64 x86_64 GNU/Linux

我已经阅读了很多关于这个问题的网页。有人说这是一个内存问题而其他人说libxml丢失了。这两种情况都不适用于我。还有什么呢?

Collecting lxml
  Downloading lxml-3.4.2.tar.gz (3.5MB)
    /usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.2.
    Building without Cython.
    Using build configuration of libxslt 1.1.17
    Minimum required version of libxslt is 1.1.17, found 1.1.23
    Building against libxml2/libxslt in the following directory: /usr/lib64
Installing collected packages: lxml
  Running setup.py install for lxml
    /usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
      warnings.warn(msg)
    Building lxml version 3.4.2.
    Building without Cython.
    Using build configuration of libxslt 1.1.17
    Minimum required version of libxslt is 1.1.17, found 1.1.23
    Building against libxml2/libxslt in the following directory: /usr/lib64
    building 'lxml.etree' extension
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/tmp/pip-build-idzRLz/lxml/src/lxml/inclu$
    In file included from src/lxml/lxml.etree.c:239:
    /tmp/pip-build-idzRLz/lxml/src/lxml/includes/etree_defs.h:19:4: error: #error minimum required version of libxml2 is 2.7.0
    /tmp/pip-build-idzRLz/lxml/src/lxml/includes/etree_defs.h:28:4: error: #error minimum required version of libxslt is 1.1.23
    src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_9XMLParser___init__’:
    src/lxml/lxml.etree.c:103123: error: ‘XML_PARSE_HUGE’ undeclared (first use in this function)
    src/lxml/lxml.etree.c:103123: error: (Each undeclared identifier is reported only once
    src/lxml/lxml.etree.c:103123: error: for each function it appears in.)
    src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_10Schematron_6__call__’:
    src/lxml/lxml.etree.c:176893: error: ‘XML_SCHEMATRON_OUT_ERROR’ undeclared (first use in this function)
    error: command 'gcc' failed with exit status 1
    Complete output from command /home/odoo/odoo/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-idzRLz/lxml/setup.py';exec(compile(getattr(toke$
    /usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'

      warnings.warn(msg)

    Building lxml version 3.4.2.

    Building without Cython.

2 个答案:

答案 0 :(得分:1)

我有类似的问题。一切都是通过设置几个库来决定的

sudo apt-get install libxslt1-dev libxml2-dev

已找到解决方案,感谢onesecond

答案 1 :(得分:0)

Installing lxml您可以看到最新的lxml需要 libxml2版本2.7.0或更高版本 libxslt版本1.1.23或更高版本,这是#39;已安装在您的系统上。

你可以:

  • 更新您的libxslt, e.x。下载rpm here

  • 如果您的系统没有正确的版本支持(例如 CentOS 5 ),您可以选择 lxml 2.2.2 等订单版本这也适用于很多情况。