常用網址:
- Python 3.5: https://www.python.org/downloads/
- Wheel文件:http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
參考文章:
- https://www.webucator.com/blog/2015/03/how-to-install-lxml-for-python-3-on-64-bit-windows/
- http://stackoverflow.com/questions/23944465/installing-lxml-for-python-3-4-on-windows-x-86-32-bit-with-visual-studio-c-2
安裝步驟:
- 從Python官網下載Python進行安裝:
- 打開http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml去下載lxml的Wheel文件
- 打開CMD
- 進到lxml下載到的文件夾(或者調用命令的時候傳給lxml的全路徑)運行如下命令:
pip3 install lxml-3.5.0-cp35-none-win32.whl
- 運行pip3安裝Scrapy:
pip3 install scrapy
- 大功告成
題外話:
等了好長時間,Scrapy終於支持Python3了。但是Windows上安裝Scrapy的時候就遇到各種問題:
- error: Unable to find vcvarsall.bat
- 找不到"libxml/xmlversion.h"
- <各種問題可以參考上面給到的第二個鏈接,但是各種方法都試了還是有這樣那樣的問題>......
最后終於在https://www.webucator.com/blog/2015/03/how-to-install-lxml-for-python-3-on-64-bit-windows/上面找到了更方便的方法,使用Wheel的方式安裝lxml,然后問題就很輕松的解決掉了。