python 3.4 vc++编译配置,使用Visual Studio C ++ 2010 Express在Windows x 86(32位)上为Python 3.4安装lxml...

Related

Related questions:

Related answers:

Related comments:

"@ziyuang This would mean you use Python 3.3 which uses Microsoft Visual Studio 2010. If that's the case then the answer is yes, you should install this version."

Facts

Windows x86 (32-bit)

Installed both Visual Studio C++ 2008 (from here) Express and Visual Studio C++ 2010 (from here)

Python 3.4.1 (apparently compiled with newer version than Visual Studio 2008)

I use pip (or pip3.4.exe; builtin to Python 3.4) to pip install lxml

distutils uses Visual Studio C++ 2010 Express to compile

The last few lines of my error, logged by pip:

cl : Command line warning D9025 : overriding '/W3' with '/w'

lxml.etree.c

C:\Users\NATHAN~1\AppData\Local\Temp\pip_build_nathanielanderson\lxml\src\lxml\includes\etree_defs.h(9)

: fatal error C1083: Cannot open include file: 'libxml/xmlversion.h':

No such file or directory

C:\Python34\lib\distutils\dist.py:260: UserWarning: Unknown

distribution option: 'bugtrack_url'

warnings.warn(msg)

error: command 'C:\Program Files\Microsoft Visual Studio

10.0\VC\BIN\cl.exe' failed with exit status 2

So I can't install from the .egg or by compiling...

Recourse

I also can't find Windows installer (exe or msi or whatever) for this version of Python

Looks like Chris does provide a direct exe here:

Thanks, Chris! Any ideas why I cannot compile using pip?

解决方案

I also got this problem, but the workarounds provided above are not work for me as well.

Here is my system configuration:

Win7 64bit

python3.3

visual studio 2013

I tried to use the method in the first link in the Related questions, but it's fail. This method is to create a system variable for vs2010 use, and the variable is actually copy from my original configuration in visual studio 2013.

However, the command line prompted error with "libxml/xmlversion.h" no suck file or directory

Then I further searched it on the internet and got a method which works in my case.

downloading the precompiled lxml plugin

if your system is 64bit, then you can get a unofficial version for x64 at here: http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml (this is what i use)

installing with command in command line easy_install lxml-3.2.1.win32-py3.3.‌exe

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值