python安装lxml,在windows环境下
2016-12-13 13:02
525 查看
python安装lxml,在windows环境下
windows环境下真是折腾。直接pip install lxml,会报错,
看提示:“make sure the development packages of libxml2 and libxslt are installed” 意识到有依赖,
于是就pip install libxml2..结果就懵逼了 = =,原来不是Python库。
[plain] view
plain copy
Collecting libxml2
Could not find a version that satisfies the requirement libxml2 (from versions: )
No matching distribution found for libxml2
翻了好久,左拐又拐,各种尝试,最后才发现这个地址http://lxml.de/installation.html ,官方安装说明,
You need Python 2.6 or later.
libxml2 version
2.7.0 or later.
libxslt version
1.1.23 or later.
在Linux下安装的过程跳过,可以参考文档说明
在windows下,建议是直接使用二进制文件安装。
unofficial
Windows binaries:http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
随便下了一个,在pip install *whl 失败!提示说平台不支持,又蒙了
[plain] view
plain copy
is not a supported wheel on this platform
原来,lxml-3.4.4-cp34-none-win32.whl ,cp34对应不同的Python版本支持,需要查看自己的Python版本支持情况:
[python] view
plain copy
import pip; print(pip.pep425tags.get_supported())
[python] view
plain copy
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (In
Type "help", "copyright", "credits" or "license" for more information.
>>> import pip; print(pip.pep425tags.get_supported())
[('cp34', 'none', 'win32'), ('py3', 'none', 'win32'), ('cp34', 'none', 'any'), (
e', 'any'), ('cp32', 'none', 'any'), ('cp31', 'none', 'any'), ('cp30', 'none', '
3', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', '
')]
显然,用cp34-none-w
c4d4
in32才可以
[python] view
plain copy
pip install lxml-3.4.4-cp34-none-win32.whl
windows环境下成功安装lxml。
[python] view
plain copy
Processing d:\order\lxml-3.4.4-cp34-none-win32.whl
Installing collected packages: lxml
Successfully installed lxml-3.4.4
最终是成功解决了,但是这个过程却有些意外,有必要记录一下,也算是涨经验了。
转载:http://blog.csdn.net/g1apassz/article/details/46574963
相关文章推荐
- python安装lxml,在windows环境下
- python MySQLdb在windows环境下的快速安装、问题解决方式
- windows上python和django开发环境的安装和配置
- windows 环境安装 MySQL-python 遇到错误 serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['regi
- Windows 7 安装64位 Python 2.7.3 开发环境
- 1.1、安装Python 2.7.4开发环境(windows+Linux)
- windows下Python,wxPython,py2exe开发环境安装与配置
- windows 下安装 python lxml
- python MySQLdb在windows环境下的快速安装、问题解决方式 【转】
- 在Windows系统下设置Python的环境变量,以及安装BeautifulSoup
- 在windows下如何安装lxml的python包
- eclipse+pydev+Django安装和配置Python开发环境(For Windows OS)
- windows环境下python web开发环境安装配置
- [100_Python学习笔记]001_Python环境安装配置(Windows 7)
- Windows下Python环境搭建(包括Win7 64位下安装setuptools)
- GDAL 在windows python环境下的安装步骤
- Python Django 第一步:安装配置 windows环境
- Windows下Python环境安装配置
- 在windows下安装配置python开发环境及Ulipad开发工具(转)
- 1.1、安装Python 2.7.4开发环境(windows+Linux)