標籤:htm windows平台 top 檔案 openssl failed ted pat 命令
按理說直接:pip install scrapy
就可以成功,但是出現了錯誤“libxml/xpath.h: No such file or directory”
“error:failed with exit status 2”
(百度上有很多解決方案而且大多相同,但是都沒解決我的問題)
最後還是上官網找解決方案:https://doc.scrapy.org/en/latest/intro/install.html
Scrapy is written in pure Python and depends on a few key Python packages (among others):
- lxml, an efficient XML and HTML parser
- parsel, an HTML/XML data extraction library written on top of lxml,
- w3lib, a multi-purpose helper for dealing with URLs and web page encodings
- twisted, an asynchronous networking framework
- cryptography and pyOpenSSL, to deal with various network-level security need
然後就按著上面的一個一個包下載(因人而異)
如果沒有安裝Wheel 要先安裝:pip install wheel
我只是lxml沒有,所以我就只通過:pip install lxml==3.4.2
得到安裝包lxml-3.4.2-cp27-none-win32.whl 安裝lxml成功!
(這裡再說一下我之前因為用命令總安裝不成功,就想著直接下.whl檔案再安裝,但總是下錯版本,所以如果上面這個版本你用不了,可以去http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml 這個網站上找對應版本)
最後就可以愉快地:pip install scrapy
安裝成功!
Windows平台下,Scrapy Installation,安裝問題解決