windows7 安裝 Scrapy
阿新 • • 發佈:2018-03-14
scrapy##windows7 安裝 Scrapy##
1.打開cmd.exe輸入命令:
C:\Users\admin>python
先看是否已經安裝python,沒有就安裝python,此處省略安裝python。
2.假設已經安裝有python,查看是否已經安裝好pip
C:\Users\admin>pip
a. 沒有就去下載pip 網址如下:https://pypi.python.org/pypi/pip#downloads 下載這個壓縮包:pip-9.0.1.tar.gz (md5, pgp) b. 解壓到指定目錄,進入pip-9.0.1目錄,輸入此命令 python setup.py install c. 如果出現以下錯誤: Traceback (most recent call last): File "setup.py", line 31, in <module> from setuptools import setup, find_packages ImportError: No module named setuptools d. 就安裝setuptools: 網址:https://pypi.python.org/pypi/setuptools 下載這個壓縮包:setuptools-38.5.2.zip (md5) f. 解壓到指定目錄,進入setuptools-38.5.2目錄,輸入此命令 python setup.py install g. 如果出現以下錯誤: running build_ext building ‘twisted.test.raiser‘ extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools 網址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted h. 下載二選一: Twisted?17.9.0?cp36?cp36m?win_amd64.whl(看系統位數下載) Twisted?17.9.0?cp36?cp36m?win32.whl(看系統位數下載)
3.安裝scrapy
C:\Users\admin>pip install Scrapy
成功後提示:
Installing collected packages: Scrap
Successfully installed Scrapy-1.5.0
4.如果運行scapy crawl quotes【quotes是項目名字】報錯,就安裝pypiwin32
C:\Users\admin>pip install pypiwin32
5.再次運行就會成功
windows7 安裝 Scrapy