pyspider的安裝很好安裝,直接window +r打開搜索框,輸入cmd,打開命令窗口。輸入pip install pyspider。即可安裝。
1.安裝過程出現問題:
ERROR: Could not find a version that satisfies the requirement lxml (from pyspider) (from versions: none)
ERROR: No matching distribution found for lxml (from pyspider)
我這裏是因爲網絡不好,這個時候再使用 pip install pysider,用了5次才重裝完成
2.在cmd窗口內直接輸入pyspider,顯示如下問題:
c:\users\magic\appdata\local\programs\python\python36-32\lib\site-packages\pyspider\libs\utils.py:196: FutureWarning: timeout is not supported on your platform.
warnings.warn("timeout is not supported on your platform.", FutureWarning)
[W 200205 16:33:29 run:413] phantomjs not found, continue running without it.
……
Deprecated option 'domaincontroller': use 'domain_controller' instead的問題。
解決:
wsgidav發佈的3.x版本目前仍然是測試版,相對於2.x(例如2.4.1)更改了一些用法,上面報錯的兩個部分就是的。pyspider的3.0及以上版本在安裝時,會默認安裝wsgidav的3.x版(具體的版本可能會有偏差)。其實上面錯誤信息已經提示該如何改了,不過那樣改比較麻煩。可以換個方法,換回wsgidav的2.x版本就不會報錯了。先把3.x版卸載,再裝2.x版(pip安裝wsgidav會默認安裝2.x版 我的是2.4.1版)。下面是具體的卸載安裝的命令
windows下進入cmd,(linux下打開終端),輸入:
pip uninstall wsgidav
pip install wsgidav
如果報錯失敗,按照下面的再試一次,(一般linux不會出錯,windows下可能輸入下面的命令)
python -m pip uninstall wsgidav
python -m pip install wsgidav
如果安裝的wsgidav版本還是3.x版本,可以在卸載這個版本之後, 在安裝命令後面加上具體版本
例如 python -m pip install wsgidav==2.4.1