V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
spkingr
V2EX  ›  Python

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

  •  
  •   spkingr · 2016-10-21 11:31:38 +08:00 · 3893 次点击
    这是一个创建于 2963 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我自己到 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\
    25 条回复    2024-10-11 15:25:59 +08:00
    spkingr
        1
    spkingr  
    OP
       2016-10-21 11:39:24 +08:00
    刚刚安装了 beautifulsoup4 ,成功了,看了下简介有 beautifulsoup3 和 4 , 4 是适合 python3 的,那么 lxml 是不是也有版本要求?比如 pip install lxml4 ? 我看了下 lxml 的下载页面,没有这个方面的说明,只是说 github 上可以下载 dev 版本的 lxml
    stamaimer
        2
    stamaimer  
       2016-10-21 11:59:37 +08:00 via iPhone
    pip install lxml
    sammiriam
        3
    sammiriam  
       2016-10-21 12:45:42 +08:00
    windows 下面尝试用 wheel 安装与 c 有关的类库
    chendajun
        4
    chendajun  
       2016-10-21 13:13:54 +08:00
    安装 lxml 的 whl 文件,不要直接 pip install lxml 。
    spkingr
        5
    spkingr  
    OP
       2016-10-21 16:36:39 +08:00
    @stamaimer 我是用这个方法安装的, pip install lxml
    xidianlz
        6
    xidianlz  
       2016-10-21 16:52:58 +08:00
    人生苦短 还是不要用 win 开发了
    spkingr
        7
    spkingr  
    OP
       2016-10-21 16:57:21 +08:00
    @sammiriam 谢谢!已经放弃了,看了下只有 3.2 版本的 lxml 还是 win32 的,我的是 x64 不支持。
    spkingr
        8
    spkingr  
    OP
       2016-10-21 16:57:43 +08:00
    @chendajun 谢谢!已经放弃了,看了下只有 3.2 版本的 lxml 还是 win32 的,我的是 x64 不支持,算了吧。
    spkingr
        9
    spkingr  
    OP
       2016-10-21 16:58:00 +08:00
    @xidianlz 哦? 用什么开发? 又不是专业啊。。。
    arischow
        10
    arischow  
       2016-10-21 17:09:31 +08:00 via iPhone
    找一下,可以解决的,大概记得要手动装, Google 一下会找到答案
    xidianlz
        11
    xidianlz  
       2016-10-21 17:14:24 +08:00
    @spkingr 资金不足转个虚拟机 在虚拟机里开发就好,资金足直接上苹果吧。
    beibeijia
        12
    beibeijia  
       2016-10-21 17:23:10 +08:00
    新手刚上路还是用稳定性好点的低版本,瞎折腾的地方少。
    hljjhb
        13
    hljjhb  
       2016-10-21 17:25:18 +08:00   ❤️ 1
    loryyang
        14
    loryyang  
       2016-10-21 17:25:21 +08:00
    最好不要用 windows ,简单的话可以搞个虚拟机,很方便的
    sammiriam
        15
    sammiriam  
       2016-10-21 19:05:39 +08:00
    @spkingr 别放弃, 13 楼已经给了你答案。
    firekiller
        16
    firekiller  
       2016-10-22 12:25:40 +08:00
    请参见第 13 楼。
    安装已经编译好的 whl 文件
    鄙人安装成功。
    spkingr
        17
    spkingr  
    OP
       2016-10-22 13:02:29 +08:00
    @xidianlz 哦,懂了,谢谢!
    spkingr
        18
    spkingr  
    OP
       2016-10-22 13:03:03 +08:00
    @arischow 恩,谢谢! 13 楼给我答案了
    spkingr
        19
    spkingr  
    OP
       2016-10-22 13:03:21 +08:00
    @beibeijia OK ,谢谢!
    spkingr
        20
    spkingr  
    OP
       2016-10-22 13:06:42 +08:00
    @hljjhb 非常感谢! already successfully installed ....
    spkingr
        21
    spkingr  
    OP
       2016-10-22 13:07:14 +08:00
    @loryyang 恩。初尝试。。。
    spkingr
        22
    spkingr  
    OP
       2016-10-22 13:07:31 +08:00
    @sammiriam 是的,谢谢!
    spkingr
        23
    spkingr  
    OP
       2016-10-22 13:07:47 +08:00
    @firekiller 刚试了,成功了,谢谢!
    realpg
        24
    realpg  
       2016-10-22 17:08:13 +08:00
    抛弃 windows 吧……
    spkingr
        25
    spkingr  
    OP
       50 天前
    8 年过去了,我还是没解决这个问题,回头再看,8 年我学会了什么?
    [那个煞笔就是你]
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2562 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:49 · PVG 13:49 · LAX 21:49 · JFK 00:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.