在用pip install Scrapy安装scrapy时出错
error: command 'C:\\Users\\rainer\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status2
网上找了很久,发现很多人遇到这个错误没有解决,最后在stackoverflow找到解决办法改用这个命令安装lxml就好了:set STATICBUILD=true && pip install lxml
原帖地址:http://stackoverflow.com/questions/20460890/lxml-install-on-windows-7-using-pip-and-python-2-7
If you have a compiler installed (tested with VS C++ 2008 Express), you can simply run:
set STATICBUILD=true && pip install lxml
As pointed out on documentation, setting STATICBUILD
will tell to lxml's installer to automatically download all its binary dependencies before build.
These lxml
binary dependencies, that should be present when installing from source, will be downloaded and build together by the installer:
- libxslt
- iconv
- zlib
- libxml2
Bonus: It also works inside a virtualenv.