新手求助!新手上路,遇到奇怪的问题,搜索了很多地方没解决,请问大家有没有什么解决办法?

2016-10-21 11:31:38 +08:00
 spkingr
我自己到 https://pypi.python.org/pypi/lxml/3.4.4#downloads 这里下载 lxml-3.4.4.win-amd64-py3.4.exe (md5),结果运行的时候说 python 3.4 没有发现,我晕了,我安装的是 3.5 ,难道不能向前兼容吗?
求助了,谢谢!
################

D:\Software\Programme\Python35\Scripts>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:\software\programme\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Qingwen\\AppData\\Local\\Temp\\pip-build-lsazecfw\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Qingwen\AppData\Local\Temp\pip-thoy_nfg-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.win-amd64-3.5
creating build\lib.win-amd64-3.5\lxml
copying src\lxml\builder.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\cssselect.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\doctestcompare.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\ElementInclude.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\sax.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\usedoctest.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\_elementpath.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\__init__.py -> build\lib.win-amd64-3.5\lxml
creating build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win-amd64-3.5\lxml\includes
creating build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\builder.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\clean.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\defs.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\diff.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win-amd64-3.5\lxml\html
creating build\lib.win-amd64-3.5\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-3.5\lxml\isoschematron
copying src\lxml\lxml.etree.h -> build\lib.win-amd64-3.5\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-3.5\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-3.5\lxml\includes
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\rng
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl
creating build\lib.win-amd64-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-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-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.win-amd64-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.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Unable to find vcvarsall.bat

----------------------------------------
Command "d:\software\programme\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Qingwen\\AppData\\Local\\Temp\\pip-build-lsazecfw\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Qingwen\AppData\Local\Temp\pip-thoy_nfg-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Qingwen\AppData\Local\Temp\pip-build-lsazecfw\lxml\

D:\Software\Programme\Python35\Scripts>easy_install --version
setuptools 20.10.1 from d:\software\programme\python35\lib\site-packages (Python 3.5)

D:\Software\Programme\Python35\Scripts>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:\software\programme\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Qingwen\\AppData\\Local\\Temp\\pip-build-v7ce26yr\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Qingwen\AppData\Local\Temp\pip-cddydwh4-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.win-amd64-3.5
creating build\lib.win-amd64-3.5\lxml
copying src\lxml\builder.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\cssselect.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\doctestcompare.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\ElementInclude.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\sax.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\usedoctest.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\_elementpath.py -> build\lib.win-amd64-3.5\lxml
copying src\lxml\__init__.py -> build\lib.win-amd64-3.5\lxml
creating build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win-amd64-3.5\lxml\includes
creating build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\builder.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\clean.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\defs.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\diff.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-3.5\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win-amd64-3.5\lxml\html
creating build\lib.win-amd64-3.5\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-3.5\lxml\isoschematron
copying src\lxml\lxml.etree.h -> build\lib.win-amd64-3.5\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-3.5\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-3.5\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-3.5\lxml\includes
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\rng
creating build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl
creating build\lib.win-amd64-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-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-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.win-amd64-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.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
error: Unable to find vcvarsall.bat

----------------------------------------
Command "d:\software\programme\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Qingwen\\AppData\\Local\\Temp\\pip-build-v7ce26yr\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Qingwen\AppData\Local\Temp\pip-cddydwh4-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Qingwen\AppData\Local\Temp\pip-build-v7ce26yr\lxml\
3971 次点击
所在节点    Python
25 条回复
spkingr
2016-10-21 11:39:24 +08:00
刚刚安装了 beautifulsoup4 ,成功了,看了下简介有 beautifulsoup3 和 4 , 4 是适合 python3 的,那么 lxml 是不是也有版本要求?比如 pip install lxml4 ? 我看了下 lxml 的下载页面,没有这个方面的说明,只是说 github 上可以下载 dev 版本的 lxml
stamaimer
2016-10-21 11:59:37 +08:00
pip install lxml
sammiriam
2016-10-21 12:45:42 +08:00
windows 下面尝试用 wheel 安装与 c 有关的类库
chendajun
2016-10-21 13:13:54 +08:00
安装 lxml 的 whl 文件,不要直接 pip install lxml 。
spkingr
2016-10-21 16:36:39 +08:00
@stamaimer 我是用这个方法安装的, pip install lxml
xidianlz
2016-10-21 16:52:58 +08:00
人生苦短 还是不要用 win 开发了
spkingr
2016-10-21 16:57:21 +08:00
@sammiriam 谢谢!已经放弃了,看了下只有 3.2 版本的 lxml 还是 win32 的,我的是 x64 不支持。
spkingr
2016-10-21 16:57:43 +08:00
@chendajun 谢谢!已经放弃了,看了下只有 3.2 版本的 lxml 还是 win32 的,我的是 x64 不支持,算了吧。
spkingr
2016-10-21 16:58:00 +08:00
@xidianlz 哦? 用什么开发? 又不是专业啊。。。
arischow
2016-10-21 17:09:31 +08:00
找一下,可以解决的,大概记得要手动装, Google 一下会找到答案
xidianlz
2016-10-21 17:14:24 +08:00
@spkingr 资金不足转个虚拟机 在虚拟机里开发就好,资金足直接上苹果吧。
beibeijia
2016-10-21 17:23:10 +08:00
新手刚上路还是用稳定性好点的低版本,瞎折腾的地方少。
hljjhb
2016-10-21 17:25:18 +08:00
loryyang
2016-10-21 17:25:21 +08:00
最好不要用 windows ,简单的话可以搞个虚拟机,很方便的
sammiriam
2016-10-21 19:05:39 +08:00
@spkingr 别放弃, 13 楼已经给了你答案。
firekiller
2016-10-22 12:25:40 +08:00
请参见第 13 楼。
安装已经编译好的 whl 文件
鄙人安装成功。
spkingr
2016-10-22 13:02:29 +08:00
@xidianlz 哦,懂了,谢谢!
spkingr
2016-10-22 13:03:03 +08:00
@arischow 恩,谢谢! 13 楼给我答案了
spkingr
2016-10-22 13:03:21 +08:00
@beibeijia OK ,谢谢!
spkingr
2016-10-22 13:06:42 +08:00
@hljjhb 非常感谢! already successfully installed ....

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://tanronggui.xyz/t/314365

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX