在此答案中,告诉我不要BeautifulSoup(xmlData, 'html.parser')
用于XML
解析,而要使用BeautifulSoup(xmlData, 'xml')
。但是,该解析器不附带BeautifulSoup
。
根据评论之一,我尝试了:
python -m pip install lxml
但是得到了:
Collecting lxml
Using cached lxml-3.6.4.tar.gz
Installing collected packages: lxml
Running setup.py install for lxml ... error
Complete output from command D:\SOFT\Python3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\U
sers\\myuser\\AppData\\Local\\Temp\\pip-build-hl9fxzny\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__fi
le__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:
\Users\myuser\AppData\Local\Temp\pip-ivemv19a-record\install-record.txt --single-version-externally-managed --
compile:
Building lxml version 3.6.4.
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\reso
urces\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win32-3.5\lxml\isoschematron\reso
urces\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.win
32-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.win3
2-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\i
soschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Command "D:\SOFT\Python3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\myuser\\AppData\\L
ocal\\Temp\\pip-build-hl9fxzny\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().repl
ace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\myuser\AppData\Lo
cal\Temp\pip-ivemv19a-record\install-record.txt --single-version-externally-managed --compile" failed with err
or code 1 in C:\Users\myuser\AppData\Local\Temp\pip-build-hl9fxzny\lxml\
我正在使用,Python 3.5.2
并且希望 某些东西可以正常使用pip
,这意味着不需要单独编译。
您将需要Windows上的编译器才能通过pip安装lxml。
一些非官方的版本可以在这里找到:http :
//www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
找到合适的车轮包装的URL,然后应该可以使用:
pip install http://url_to_wheel
问题内容: 我想将文件上传到s3,所以我想从本文运行上传程序:http : //www.componentix.com/blog/9 为此,我需要安装多部分模块。 https://github.com/isaacs/multipart- js 但是通过做npm install multipart它给出了错误 我应该如何安装此多部分模块,以便使该程序运行? 问题答案: 从https://github
我在尝试运行我的 React Native Expo 应用程序时安装 Apollo 后遇到错误。我尝试过删除节点模块并重新安装,重置缓存,重新启动计算机,但仍然没有运气。 Android 捆绑失败 456 毫秒 尝试从文件解析模块 < Li >/mnt/c/Users/14044/Desktop/Coding/divi/client/node _ modules/@ Apollo/client/m
本文向大家介绍python安装模块如何通过setup.py安装(超简单),包括了python安装模块如何通过setup.py安装(超简单)的使用技巧和注意事项,需要的朋友参考一下 有些时候我们发现一些模块没有提供pip install 命令和安装教程 , 只提供了一个setup.py文件 , 这个时候如何安装呢? 步骤 打开cmd 到达安装目录 python setup.py build pyth
问题内容: 如何使用pip为Python 安装MySQLdb模块? 问题答案: 这很容易,但是很难记住正确的拼写: 如果您需要1.2.x版本(仅限旧版Python),请使用 注意:运行上述命令时,某些依赖项可能必须存在。关于如何在各种平台上安装这些的一些提示: Ubuntu 14,Ubuntu 16,Debian 8.6(jessie) Fedora 24: 苹果系统 如果失败,请尝试
问题内容: Google App Engine启动器告诉我: 警告appengine_rpc.py:399找不到ssl模块。如果没有ssl模块,则无法验证远程主机的身份,并且连接可能不安全。要解决此问题,请从http://pypi.python.org/pypi/ssl安装ssl模块 。 我下载了软件包,其中包含一个文件。我跑了: 接着: 然后我安装了MinGW32,现在编译不起作用。编译错误的末
问题内容: 我最近在OSX上安装了Node.js和npm模块,我认为设置有问题: 问题答案: 如果要全局安装npm模块,请确保使用new 标志,例如: 从1.0rc开始有关npm模块安装的一般建议(摘自blog.nodejs.org): 如果要安装要在程序中使用的东西,请使用require(’whatever’),然后 将其本地安装 在项目的根目录下。 如果要在外壳程序中安装要使用的东西,在命令行