简体   繁体   English

在Python中使用lxml-Windows 7 64位

[英]Using lxml for Python - Windows 7 64-bit

When I try to install lxml, I get the following. 当我尝试安装lxml时,得到以下信息。 I've tried downloading C++ redists and a whole bunch of other things I've found, but nothing works. 我尝试下载C ++ redist和我发现的许多其他内容,但是没有任何效果。

I've tried everything from the following link: 我已经尝试了以下链接中的所有内容:

How to install lxml on Windows 如何在Windows上安装LXML

I've got python version 3.5.1. 我有python版本3.5.1。 I 一世

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\daniel.bak>pip install setuptools
Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\users\daniel.bak\appdata\local\programs\python\python35-32\lib\site-packages

C:\Users\daniel.bak>pip install lxml
Collecting lxml
  Using cached lxml-3.6.0.tar.gz
Installing collected packages: lxml
  Running setup.py install for lxml ... error
    Complete output from command c:\users\daniel.bak\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\daniel.bak\\AppData\\Local\\Temp\\pip-build-_d7bp49n\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replac
e('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\daniel.bak\AppData\Local\Temp\pip-4wmqb1li-record\install-record.txt --single-version-externally-managed --compile:
    Building lxml version 3.6.0.
    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
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.5
    creating build\lib.win32-3.5\lxml
    copying src\lxml\builder.py -> build\lib.win32-3.5\lxml
    copying src\lxml\cssselect.py -> build\lib.win32-3.5\lxml
    copying src\lxml\doctestcompare.py -> build\lib.win32-3.5\lxml
    copying src\lxml\ElementInclude.py -> build\lib.win32-3.5\lxml
    copying src\lxml\pyclasslookup.py -> build\lib.win32-3.5\lxml
    copying src\lxml\sax.py -> build\lib.win32-3.5\lxml
    copying src\lxml\usedoctest.py -> build\lib.win32-3.5\lxml
    copying src\lxml\_elementpath.py -> build\lib.win32-3.5\lxml
    copying src\lxml\__init__.py -> build\lib.win32-3.5\lxml
    creating build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\__init__.py -> build\lib.win32-3.5\lxml\includes
    creating build\lib.win32-3.5\lxml\html
    copying src\lxml\html\builder.py -> build\lib.win32-3.5\lxml\html
    copying src\lxml\html\clean.py -> build\lib.win32-3.5\lxml\html
    copying src\lxml\html\defs.py -> build\lib.win32-3.5\lxml\html
    copying src\lxml\html\diff.py -> build\lib.win32-3.5\lxml\html
    copying src\lxml\html\ElementSoup.py -> build\lib.win32-3.5\lxml\html
    copying src\lxml\html\formfill.py -> build\lib.win32-3.5\lxml\html
    copying src\lxml\html\html5parser.py -> build\lib.win32-3.5\lxml\html
    copying src\lxml\html\soupparser.py -> build\lib.win32-3.5\lxml\html
    copying src\lxml\html\usedoctest.py -> build\lib.win32-3.5\lxml\html
    copying src\lxml\html\_diffcommand.py -> build\lib.win32-3.5\lxml\html
    copying src\lxml\html\_html5builder.py -> build\lib.win32-3.5\lxml\html
    copying src\lxml\html\_setmixin.py -> build\lib.win32-3.5\lxml\html
    copying src\lxml\html\__init__.py -> build\lib.win32-3.5\lxml\html
    creating build\lib.win32-3.5\lxml\isoschematron
    copying src\lxml\isoschematron\__init__.py -> build\lib.win32-3.5\lxml\isoschematron
    copying src\lxml\lxml.etree.h -> build\lib.win32-3.5\lxml
    copying src\lxml\lxml.etree_api.h -> build\lib.win32-3.5\lxml
    copying src\lxml\includes\c14n.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\config.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\dtdvalid.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\etreepublic.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\htmlparser.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\relaxng.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\schematron.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\tree.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\uri.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\xinclude.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\xmlerror.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\xmlparser.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\xmlschema.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\xpath.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\xslt.pxd -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\etree_defs.h -> build\lib.win32-3.5\lxml\includes
    copying src\lxml\includes\lxml-version.h -> build\lib.win32-3.5\lxml\includes
    creating build\lib.win32-3.5\lxml\isoschematron\resources
    creating build\lib.win32-3.5\lxml\isoschematron\resources\rng
    copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win32-3.5\lxml\isoschematron\resources\rng
    creating build\lib.win32-3.5\lxml\isoschematron\resources\xsl
    copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl
    copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl
    creating build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    running build_ext
    building 'lxml.etree' extension
    error: Unable to find vcvarsall.bat

    ----------------------------------------
Command "c:\users\daniel.bak\appdata\local\programs\python\python35-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\daniel.bak\\AppData\\Local\\Temp\\pip-build-_d7bp49n\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file_
_, 'exec'))" install --record C:\Users\daniel.bak\AppData\Local\Temp\pip-4wmqb1li-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\daniel.bak\AppData\Local\Temp\pip-build-_d7bp49n\lxml\

Installing the precompiled binaries gives me: 安装预编译的二进制文件给我:

C:\Users\daniel.bak>pip install "C:\Users\daniel.bak\Downloads\lxml-3.6.0-cp35-cp35m-win_amd64.whl"
lxml-3.6.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.

You can download precompiled binaries and install them with pip install 您可以下载预编译的二进制文件并通过pip install

Here is the download link . 这是下载链接 cp27 , cp34 , cp35 indicate Python versions and win32 and win_amd64 32 and 64 bit packages. cp27cp34cp35表示Python版本以及win32win_amd64 32位和64位软件包。

I was having trouble installing lxml on my system as well along with urllib. 我在与urllib一起在系统上安装lxml时遇到麻烦。 I do not remember why but lxml was not available for python 3.5, urllib itself is not available but instead it is available as urllib.requests and another package that I do not remember. 我不记得为什么,但是lxml对于python 3.5不可用,urllib本身不可用,但是它可以作为urllib.requests和另一个我不记得的包使用。 For me the best solution was to install anaconda instead. 对我而言,最好的解决方案是安装anaconda。 Anaconda has just so many libraries and it works greatly in place of python. Anaconda有这么多库,它可以很好地代替python。 It has the whole url library and a comprehension of several other libraries. 它具有完整的url库和其他几个库的理解。

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

相关问题 在32位Windows上使用64位Python? - 64-bit Python on 32 Bit Windows? 在64位Windows 7计算机上使用Python构建Com服务器 - Com server build using Python on 64-bit Windows 7 machine 我无法在 Windows 10 64 位上使用带有 python 3.9.0 64 位的 pip 安装任何软件包 - I unable to install any package using pip with python 3.9.0 64-bit on Windows 10 64-bit 在64位python ctypes中使用msvcrt - Using msvcrt in 64-bit python ctypes 有没有办法在 Windows 上使用 32 位 python 2.7 从线程打开 64 位 exe? - Is there a way to open a 64-bit exe from a thread using 32-bit python 2.7 on windows? 如何安装LXML Python 3.3 Windows 8 64位 - How to install LXML Python 3.3 Windows 8 64 Bit 无法使用 Python 2.7、PyQt 4.11 和 Windows 7 64 位为 QFileDialog 设置默认过滤器 - Unable to set default filter for QFileDialog using Python 2.7, PyQt 4.11, and Windows 7 64-bit 当 Python 是 64 位时,为什么我不能在 Windows 上使用 pip 安装 angr-z3? - Why can't I install angr-z3 using pip on Windows when Python is 64-bit? 在Windows上构建64位C Python扩展 - Building 64-bit C Python extensions on Windows 在Windows上获取PILow而不是Pillow for Python 2.7 64位 - Obtaining PIL instead of Pillow for Python 2.7 64-bit on Windows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM