Pip或easy_使用Python3.x安装在使用mingw安装任何东西时会爆炸

Pip或easy_使用Python3.x安装在使用mingw安装任何东西时会爆炸,python,python-3.x,pip,easy-install,Python,Python 3.x,Pip,Easy Install,我遇到了vcvarsall.bat问题,所以我按照这里的说明操作 现在,在Windows 7上对Python 3.2.2使用pip install lxml时,出现以下错误: C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python32\include -IC:\Pytho n32\PC -c src/lxml/lxml.etree.c -o build\temp.win32-3.2\Release\src\lxml\lxml.et

我遇到了vcvarsall.bat问题,所以我按照这里的说明操作

现在,在Windows 7上对Python 3.2.2使用
pip install lxml
时,出现以下错误:

C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python32\include -IC:\Pytho
n32\PC -c src/lxml/lxml.etree.c -o build\temp.win32-3.2\Release\src\lxml\lxml.et
ree.o -w

cc1.exe: error: unrecognized command line option '-mno-cygwin'

error: command 'gcc' failed with exit status 1
整个输出:

C:\Python32\Scripts>pip-3.2.exe install lxml
Downloading/unpacking lxml
  Real name of requirement lxml is lxml
  Downloading lxml-2.3.3.tar.gz (3.1Mb): 3.1Mb downloaded
  Running setup.py egg_info for package lxml
    Building lxml version 2.3.3.
    Building without Cython.
    ERROR: b"'xslt-config' is not recognized as an internal or external command,
\r\noperable program or batch file.\r\n"
    ** make sure the development packages of libxml2 and libxslt are installed *
*

    Using build configuration of libxslt

    warning: no files found matching 'lxml.etree.c' under directory 'src\lxml'
    warning: no files found matching 'lxml.objectify.c' under directory 'src\lxm
l'
    warning: no files found matching 'lxml.etree.h' under directory 'src\lxml'
    warning: no files found matching 'lxml.etree_api.h' under directory 'src\lxm
l'
    warning: no files found matching 'etree_defs.h' under directory 'src\lxml'
    warning: no files found matching 'pubkey.asc' under directory 'doc'
    warning: no files found matching 'tagpython*.png' under directory 'doc'
    warning: no files found matching 'Makefile' under directory 'doc'
Installing collected packages: lxml
  Running setup.py install for lxml
    Building lxml version 2.3.3.
    Building without Cython.
    ERROR: b"'xslt-config' is not recognized as an internal or external command,
\r\noperable program or batch file.\r\n"
    ** make sure the development packages of libxml2 and libxslt are installed *
*

    Using build configuration of libxslt
    building 'lxml.etree' extension
    C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python32\include -IC:\P
ython32\PC -c src/lxml/lxml.etree.c -o build\temp.win32-3.2\Release\src\lxml\lxm
l.etree.o -w
    cc1.exe: error: unrecognized command line option '-mno-cygwin'
    error: command 'gcc' failed with exit status 1
    Complete output from command C:\Python32\python.exe -c "import setuptools;__
file__='C:\\Python32\\Scripts\\build\\lxml\\setup.py';exec(compile(open(__file__
).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-ext
ernally-managed --record c:\windows\temp\pip-w4t58y-record\install-record.txt:
    Building lxml version 2.3.3.

Building without Cython.

ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\n
operable program or batch file.\r\n"

** 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.win32-3.2

creating build\lib.win32-3.2\lxml

copying src\lxml\builder.py -> build\lib.win32-3.2\lxml

copying src\lxml\cssselect.py -> build\lib.win32-3.2\lxml

copying src\lxml\doctestcompare.py -> build\lib.win32-3.2\lxml

copying src\lxml\ElementInclude.py -> build\lib.win32-3.2\lxml

copying src\lxml\pyclasslookup.py -> build\lib.win32-3.2\lxml

copying src\lxml\sax.py -> build\lib.win32-3.2\lxml

copying src\lxml\usedoctest.py -> build\lib.win32-3.2\lxml

copying src\lxml\_elementpath.py -> build\lib.win32-3.2\lxml

copying src\lxml\__init__.py -> build\lib.win32-3.2\lxml

creating build\lib.win32-3.2\lxml\html

copying src\lxml\html\builder.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\clean.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\defs.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\diff.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\ElementSoup.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\formfill.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\html5parser.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\soupparser.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\usedoctest.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\_dictmixin.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\_diffcommand.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\_html5builder.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\_setmixin.py -> build\lib.win32-3.2\lxml\html

copying src\lxml\html\__init__.py -> build\lib.win32-3.2\lxml\html

creating build\lib.win32-3.2\lxml\isoschematron

copying src\lxml\isoschematron\__init__.py -> build\lib.win32-3.2\lxml\isoschema
tron

copying src\lxml\etreepublic.pxd -> build\lib.win32-3.2\lxml

copying src\lxml\tree.pxd -> build\lib.win32-3.2\lxml

copying src\lxml\etree_defs.h -> build\lib.win32-3.2\lxml

creating build\lib.win32-3.2\lxml\isoschematron\resources

creating build\lib.win32-3.2\lxml\isoschematron\resources\rng

copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win
32-3.2\lxml\isoschematron\resources\rng

creating build\lib.win32-3.2\lxml\isoschematron\resources\xsl

copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win32-3
.2\lxml\isoschematron\resources\xsl

copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win32-3
.2\lxml\isoschematron\resources\xsl

creating build\lib.win32-3.2\lxml\isoschematron\resources\xsl\iso-schematron-xsl
t1

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_e
xpand.xsl -> build\lib.win32-3.2\lxml\isoschematron\resources\xsl\iso-schematron
-xslt1

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_inclu
de.xsl -> build\lib.win32-3.2\lxml\isoschematron\resources\xsl\iso-schematron-xs
lt1

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron
_message.xsl -> build\lib.win32-3.2\lxml\isoschematron\resources\xsl\iso-schemat
ron-xslt1

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron
_skeleton_for_xslt1.xsl -> build\lib.win32-3.2\lxml\isoschematron\resources\xsl\
iso-schematron-xslt1

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_x
slt1.xsl -> build\lib.win32-3.2\lxml\isoschematron\resources\xsl\iso-schematron-
xslt1

copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt ->
build\lib.win32-3.2\lxml\isoschematron\resources\xsl\iso-schematron-xslt1

running build_ext

building 'lxml.etree' extension

creating build\temp.win32-3.2

creating build\temp.win32-3.2\Release

creating build\temp.win32-3.2\Release\src

creating build\temp.win32-3.2\Release\src\lxml

C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python32\include -IC:\Pytho
n32\PC -c src/lxml/lxml.etree.c -o build\temp.win32-3.2\Release\src\lxml\lxml.et
ree.o -w

cc1.exe: error: unrecognized command line option '-mno-cygwin'

error: command 'gcc' failed with exit status 1

----------------------------------------
Command C:\Python32\python.exe -c "import setuptools;__file__='C:\\Python32\\Scr
ipts\\build\\lxml\\setup.py';exec(compile(open(__file__).read().replace('\r\n',
'\n'), __file__, 'exec'))" install --single-version-externally-managed --record
c:\windows\temp\pip-w4t58y-record\install-record.txt failed with error code 1
Storing complete log in C:\Users\x\AppData\Roaming\pip\pip.log

easy_install也会发生同样的情况,但在我安装像“bible”这样的软件包时不会发生这种情况。

这是distutils的一个已知问题:

见相关SO问题:


尝试从中删除
-mno cygwin

看起来很简单。您是否检查了mingw是否可以使用libxml2和libxslt的开发包?这是你所需要的。你说得对,我就是这么做的。我仍然知道这个错误。中的libxslt包没有缺少xslt配置,我仍然收到
无法识别的命令行选项'-mno cygwin'
错误。您可能还需要检查是否安装了开发包。我相信这些将与主lib包分开。我在mingw方面没有丰富的经验,所以我不确定除此之外你还能尝试什么。我使用windows进行python开发,我只使用windows python安装。如果这是python的初始安装,如果可能的话,我会尝试这样做。您只需确保在windows上满足所有依赖项即可。我在pypi上遇到的软件包很少不能与我需要的windows一起工作。。到目前为止,我只是试着安装Cython;相同的
无法识别的命令行选项'-mno cygwin'
问题。为什么不使用?@user175492:是的,大多数搜索引擎会将-mno cygwin的搜索视为不包含“mno cygwin”的任何内容。加上引号也行。很好,但没有解决我的问题。但我认为它让我向前迈进。谢谢。如何从MingW32C编译器中删除
-mno cygwin
?如果可以用cmd命令完成,请说明。@OmarTariq:在最近的Python版本中已经修复了它(单击答案中的第一个链接)。虽然如果您正在阅读此答案,那么您的Python版本可能已经过时,您必须手动编辑机器上的源代码(单击答案中的最后一个链接)。