2017-02-07 3 views
3

После прочтения все, что я могу найти, и пытающегося многого, я не могу определить причину/решения для этого ...Python 2.7 пункта установить LXML в virtualenv терпит неудачу на Cygwin

$ pip install lxml --no-compile --only-binary=:all | grep -v 'copying\|creating' 
Collecting lxml 
    Using cached lxml-3.7.2.tar.gz 
Building wheels for collected packages: lxml 
    Running setup.py bdist_wheel for lxml: started 
    Running setup.py bdist_wheel for lxml: finished with status 'error' 
    Complete output from command /cygdrive/c/Programs/Python27.v_env.Scrapy/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ADWe5d/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmphkkbinpip-wheel- --python-tag cp27: 
    Building lxml version 3.7.2. 
    Building without Cython. 
    Using build configuration of libxslt 1.1.29 
    Building against libxml2/libxslt in the following directory: /usr/lib 
    running bdist_wheel 
    running build 
    running build_py 
    Failed building wheel for lxml 
    running build_ext 
    building 'lxml.etree' extension 
    gcc -fno-strict-aliasing -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python/python-2.7.12-1.x86_64/build=/usr/src/debug/python-2.7.12-1 -fdebug-prefix-map=/usr/src/ports/python/python-2.7.12-1.x86_64/src/Python-2.7.12=/usr/src/debug/python-2.7.12-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.cygwin-2.6.1-x86_64-2.7/src/lxml/lxml.etree.o -w 
    src/lxml/lxml.etree.c:84:20: error: Python.h: No such file or directory 
    src/lxml/lxml.etree.c:86:6: error: #error Python headers needed to compile C extensions, please install development version of Python. 
    Compile failed: command 'gcc' failed with exit status 1 
    cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInittcKSfa.c -o tmp/xmlXPathInittcKSfa.o 
    unable to execute 'cc': No such file or directory 
    ********************************************************************************* 
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? 
    ********************************************************************************* 
    error: command 'gcc' failed with exit status 1 

    ---------------------------------------- 
    Running setup.py clean for lxml 
Failed to build lxml 
Installing collected packages: lxml 
    Running setup.py install for lxml: started 
    Running setup.py install for lxml: finished with status 'error' 
    Complete output from command /cygdrive/c/Programs/Python27.v_env.Scrapy/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ADWe5d/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-Hu4l_V-record/install-record.txt --single-version-externally-managed --no-compile --install-headers /cygdrive/c/Programs/Python27.v_env.Scrapy/include/site/python2.7/lxml: 
    Building lxml version 3.7.2. 
    Building without Cython. 
    Using build configuration of libxslt 1.1.29 
    Building against libxml2/libxslt in the following directory: /usr/lib 
    running install 
    running build 
    running build_py 
    running build_ext 
    building 'lxml.etree' extension 
    gcc -fno-strict-aliasing -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python/python-2.7.12-1.x86_64/build=/usr/src/debug/python-2.7.12-1 -fdebug-prefix-map=/usr/src/ports/python/python-2.7.12-1.x86_64/src/Python-2.7.12=/usr/src/debug/python-2.7.12-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.cygwin-2.6.1-x86_64-2.7/src/lxml/lxml.etree.o -w 
    src/lxml/lxml.etree.c:84:20: error: Python.h: No such file or directory 
    src/lxml/lxml.etree.c:86:6: error: #error Python headers needed to compile C extensions, please install development version of Python. 
    Compile failed: command 'gcc' failed with exit status 1 
    cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitSsqVxY.c -o tmp/xmlXPathInitSsqVxY.o 
unable to execute 'cc': No such file or directory 
    ********************************************************************************* 
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? 
    ********************************************************************************* 
    error: command 'gcc' failed with exit status 1 

---------------------------------------- 
Command "/cygdrive/c/Programs/Python27.v_env.Scrapy/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ADWe5d/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-Hu4l_V-record/install-record.txt --single-version-externally-managed --no-compile --install-headers /cygdrive/c/Programs/Python27.v_env.Scrapy/include/site/python2.7/lxml" failed with error code 1 in /tmp/pip-build-ADWe5d/lxml/ 

Элементов по сообщениям, отсутствует, существуют, насколько я могу видеть ...

$ find /usr/include -type f -name "Python.h" 
/usr/include/python2.7/Python.h 

$ apt-cyg show python-devel python-lxml libxml2-devel libxslt-devel | grep 'sdesc\|require\|version' 
sdesc: "Python language interpreter" 
requires: bash pkg-config python 
version: 2.7.12-1 
sdesc: "Python XML2/XSLT bindings" 
requires: cygwin libxml2 libxslt python python-beautifulsoup 
version: 3.4.4-1 
sdesc: "GNOME XML library (development)" 
requires: bash libxml2 pkg-config 
version: 2.9.4-1 
sdesc: "GNOME XSLT library (development)" 
requires: bash cygwin-devel libgcrypt-devel libgpg-error-devel libiconv-devel liblzma-devel libxml2-devel libxslt pkg-config zlib-devel 
version: 1.1.29-1 

$ pip list | grep 'pip\|setup\|wheel' 
pip (9.0.1) 
setuptools (34.1.1) 
wheel (0.29.0) 

Я пытался избежать компиляции с опциями, которые я использовал на «пункт установить», но безрезультатно. Любые идеи были бы весьма полезны. Благодарю.

ответ

Смежные вопросы