Setup.py: install lxml with Python2.6 on CentOS

前端 未结 4 1331
深忆病人
深忆病人 2020-12-14 15:21

I have installed Python 2.6.6 on CentOS 5.4,

[@SC-055 lxml-2.3beta1]$ python
Python 2.6.6 (r266:84292, Jan  4 2011, 09:49:55) 
[GCC 4.1.2 20080704 (Red Hat 4         


        
相关标签:
4条回答
  • 2020-12-14 15:53

    I had the same issue, I managed to install it after installing the package libxslt-devel and python-devel which seems to be your problem:

    yum install libxslt-devel python-devel

    python setup.py install

    Installed /usr/lib/python2.6/site-packages/lxml-2.2.8-py2.6-linux-i686.egg
    Processing dependencies for lxml==2.2.8
    Finished processing dependencies for lxml==2.2.8
    

    However since I also installed other packages in the process, you might want to double check libxml2, libxml2-devel and libxslt while you are at it.

    Here is some information on how to build lxml: http://lxml.de/build.html

    0 讨论(0)
  • 2020-12-14 15:57

    If the below doesn't work

    sudo yum install libxslt-devel python-devel
    

    try this

    pip install -U pip setuptools
    

    and then install by

    pip install lxml
    
    0 讨论(0)
  • 2020-12-14 16:07

    these works for me

    yum -y install python-devel gcc libxml2 libxml2-devel libxslt libxslt-devel
    

    especially the python-devel

    0 讨论(0)
  • 2020-12-14 16:08

    It solved my problem for nokogiri in Centos

    sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel
    
    0 讨论(0)
提交回复
热议问题