2015-04-04 45 views
0

我在虚拟环境中安装odoo系统。我在安装lxml模块时遇到了问题。错误:未知的分发选项:'bugtrack_url'

我正在使用“pip --trusted-host pypi.python.org install lxml”命令,但我收到一个错误消息。我曾尝试下载源代码,但发生同样的错误。我在Linux下使用Python 2.7.9:

(odoo)[email protected] [~]# python -V 
Python 2.7.9 
(odoo)[email protected] [~]# 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. 
+0

我有同样的问题。你有没有找到解决方案? – 2015-08-20 17:23:16

回答

1

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

sudo apt-get install libxslt1-dev libxml2-dev

解决已经发现的感谢onesecond

0

Installing lxml你可以看到最新的LXML需要的libxml2版本2.7.0或更高版本libxslt版本1.1.23或更高版本,它们尚未安装在您的系统上。

,您可以:

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

  • 如果不支持您的系统(如的CentOS 5)一个正确的版本,你可以选择一个订单版本一样LXML 2.2.2这也适用于很多情况。