简体   繁体   English

错误:cl.exe失败,退出状态为2

[英]error:cl.exe failed with exit status 2

When I use pip to install lxml, I found I din't have VC, I googled a lot, but though I install Visual C++ Compiler Package for python2.7, it didn't work. 当我使用pip安装lxml时,我发现自己没有VC,我在Google上搜索了很多,但是尽管我安装了适用于python2.7的Visual C ++编译器包,但它没有用。

Here are the key points: 以下是关键点:

  1. Visual C++ Compiler Package for python2.7 installed, and reset computer 安装了适用于python2.7的Visual C ++编译器程序包,并重置计算机
  2. MinGW put into the PATH MinGW进入PATH

The following is the error 以下是错误

C:\Users\deacyn\Desktop>pip install lxml
Collecting lxml
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/4f/3f/cf6daac551fc36cddafa1a71ed48ea5fd642e5feabd3a0d83b8c3dfd0cb4/lxml-3.6.4.tar.gz
Installing collected packages: lxml
  Running setup.py install for lxml ... error
    Complete output from command "D:\Program Files\python2.7\python.exe" -u -c "import setuptools, tokenize;__file__='c:\\users\\deacyn\\appdata\\local\\temp\\pip-build-vqmbly\\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 c:\users\deacyn\appdata\local\temp\pip-mhhkdn-record\install-record.txt --single-version-externally-managed --compile:
    Building lxml version 3.6.4.
    Building without Cython.
    ERROR: 'xslt-config' 不是内部或外部命令,也不是可运行的程序
    或批处理文件。(Is not an internal or external command, nor a running program or batch file.)
** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
running install
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\lxml
copying src\lxml\builder.py -> build\lib.win-amd64-2.7\lxml
copying src\lxml\cssselect.py -> build\lib.win-amd64-2.7\lxml
copying src\lxml\doctestcompare.py -> build\lib.win-amd64-2.7\lxml
copying src\lxml\ElementInclude.py -> build\lib.win-amd64-2.7\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-2.7\lxml
copying src\lxml\sax.py -> build\lib.win-amd64-2.7\lxml
copying src\lxml\usedoctest.py -> build\lib.win-amd64-2.7\lxml
copying src\lxml\_elementpath.py -> build\lib.win-amd64-2.7\lxml
copying src\lxml\__init__.py -> build\lib.win-amd64-2.7\lxml
creating build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win-amd64-2.7\lxml\includes
creating build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\builder.py -> build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\clean.py -> build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\defs.py -> build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\diff.py -> build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-2.7\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win-amd64-2.7\lxml\html
creating build\lib.win-amd64-2.7\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-2.7\lxml\isoschematron
copying src\lxml\lxml.etree.h -> build\lib.win-amd64-2.7\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-2.7\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-2.7\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-2.7\lxml\includes
creating build\lib.win-amd64-2.7\lxml\isoschematron\resources
creating build\lib.win-amd64-2.7\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-2.7\lxml\isoschematron\resources\rng
creating build\lib.win-amd64-2.7\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-amd64-2.7\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-amd64-2.7\lxml\isoschematron\resources\xsl
creating build\lib.win-amd64-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win-amd64-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-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.win-amd64-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win-amd64-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\src
creating build\temp.win-amd64-2.7\Release\src\lxml
C:\Users\deacyn\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc\lxml\includes "-ID:\Program Files\python2.7\include" "-ID:\Program Files\python2.7\PC" /Tcsrc\lxml\lxml.etree.c /Fobuild\temp.win-amd64-2.7\Release\src\lxml\lxml.etree.obj -w
cl : Command line warning D9025 : overriding '/W3' with '/w'
lxml.etree.c
src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
Compile failed: command 'C:\\Users\\deacyn\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
creating users
creating users\deacyn
creating users\deacyn\appdata
creating users\deacyn\appdata\local
creating users\deacyn\appdata\local\temp
C:\Users\deacyn\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I/usr/include/libxml2 /Tcc:\users\deacyn\appdata\local\temp\xmlXPathInitdwvu3g.c /Fousers\deacyn\appdata\local\temp\xmlXPathInitdwvu3g.obj
xmlXPathInitdwvu3g.c
c:\users\deacyn\appdata\local\temp\xmlXPathInitdwvu3g.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 

'C:\\Users\\deacyn\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command ""D:\Program Files\python2.7\python.exe" -u -c "import setuptools, tokenize;__file__='c:\\users\\deacyn\\appdata\\local\\temp\\pip-build-vqmbly\\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 c:\users\deacyn\appdata\local\temp\pip-mhhkdn-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\deacyn\appdata\local\temp\pip-build-vqmbly\lxml\

Did you check this: Could not find function xmlCheckVersion in library libxml2. 您是否检查过:在库libxml2中找不到函数xmlCheckVersion。 Is libxml2 installed? 是否已安装libxml2?

The problem is caused by the versions.The Python version is 2.7 and the lxml is 3.6 which I originally downloaded.When I download lxml 2.2.8.exe ,I was pleasantly surprised to find that the problem was solved. 问题是由版本引起的。我最初下载的Python版本是2.7,lxml是3.6。当我下载lxml 2.2.8.exe时,我很惊讶地发现问题已解决。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python 2.7.7软件包安装给出Visual C ++ cl.exe错误:命令失败,退出状态为2 - Python 2.7.7 package installation giving Visual C++ cl.exe error: command failed with exit status 2 通过PyCharm安装PyGObject会产生错误命令'C:\\\\…\\\\ cl.exe'失败,退出状态为2 - Installing PyGObject through PyCharm yields error command 'C:\\…\\cl.exe' failed with exit status 2 在pypy3上安装熊猫时出错:…Microsoft Visual Studio 14.0 \\\\ VC \\\\ BIN \\\\ cl.exe'失败,退出状态为2 - Error with installing pandas on pypy3: …Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2 C:\\\\ Program Files \\\\ Microsoft Visual Studio 14.0 \\\\ VC \\\\ bin \\\\ cl.exe'失败,退出状态为2 - C:\\Program Files\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2 Python:Windows 10 上的“pip install gmpy”返回“cl.exe”失败,退出状态为 2” - Python: “pip install gmpy” on Windows 10 returns “cl.exe' failed with exit status 2” Python 错误:命令 'C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 14.0\\\\VC\\\\bin\\\\cl.exe' 失败,退出状态为 2 - Python error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2 Python错误:命令'C:\\\\ Program Files(x86)\\\\ Microsoft Visual Studio 14.0 \\\\ VC \\\\ BIN \\\\ cl.exe'失败,退出状态为4 - Python error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 4 Python pip安装错误:命令“ C:\\\\ Program Files(x86)\\\\ Microsoft Visual Studio 14.0 \\\\ VC \\\\ BIN \\\\ cl.exe”失败,退出状态为2 - Python pip install error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2 出现错误“错误:命令'cl.exe'失败:没有这样的文件或目录” - Have an error “ error: command 'cl.exe' failed: No such file or directory” 错误:命令“cl.exe”失败:VScode 上没有这样的文件或目录 - Error: command 'cl.exe' failed: No such file or directory on VScode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM