windows scrapy安装过程记录

记录windows scrapy安装过程记录

  1. 使用pip install scrapy 安装提示出错
Traceback (most recent call last):
  File "C:\Users\Administrator.GZLX--20160720J\AppData\Local\Programs\Python\Pyt
hon36\Scripts\pip-script.py", line 6, in 
    from pkg_resources import load_entry_point
  File "c:\users\administrator.gzlx--20160720j\appdata\local\programs\python\pyt
hon36\lib\site-packages\pkg_resources\__init__.py", line 3017, in 
    @_call_aside
  File "c:\users\administrator.gzlx--20160720j\appdata\local\programs\python\pyt
hon36\lib\site-packages\pkg_resources\__init__.py", line 3003, in _call_aside
    f(*args, **kwargs)
  File "c:\users\administrator.gzlx--20160720j\appdata\local\programs\python\pyt
hon36\lib\site-packages\pkg_resources\__init__.py", line 3030, in _initialize_ma
ster_working_set
    working_set = WorkingSet._build_master()
  File "c:\users\administrator.gzlx--20160720j\appdata\local\programs\python\pyt
hon36\lib\site-packages\pkg_resources\__init__.py", line 659, in _build_master
    ws.require(__requires__)
  File "c:\users\administrator.gzlx--20160720j\appdata\local\programs\python\pyt
hon36\lib\site-packages\pkg_resources\__init__.py", line 967, in require
    needed = self.resolve(parse_requirements(requirements))
  File "c:\users\administrator.gzlx--20160720j\appdata\local\programs\python\pyt
hon36\lib\site-packages\pkg_resources\__init__.py", line 853, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found
and is required by the application
  1. 应该是缺少pip9.0.1, 执行easy_install pip==9.0.1 查看,pip --version,提示
You are using pip version 9.0.1, however version 19.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
  1. 使用python -m pip install --upgrade pip 升级,再次错误提示
Requirement already up-to-date: pip in c:\users\administrator.gzlx--20160720j\a
pdata\local\programs\python\python36\lib\site-packages (19.0.1)
  1. 进入提示的目录中,将pip 19.0.1文件删除后,再次运行python -m pip install --upgrade pip,pip升级成功。
  2. 再次运行pip install scrapy,提示
    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
 ----------------------------------------
Command "c:\users\administrator.gzlx--20160720j\appdata\local\programs\python\py
thon36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ADMINI
~1.GZL\\AppData\\Local\\Temp\\pip-install-nqcev6r7\\Twisted\\setup.py';f=getattr
(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close()
;exec(compile(code, __file__, 'exec'))" install --record C:\Users\ADMINI~1.GZL\A
ppData\Local\Temp\pip-record-wnhyvcyx\install-record.txt --single-version-extern
ally-managed --compile" failed with error code 1 in C:\Users\ADMINI~1.GZL\AppDat
a\Local\Temp\pip-install-nqcev6r7\Twisted\
  1. 解决方案,http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted 下载twisted对应版本的whl文件(如我的Twisted‑17.5.0‑cp36‑cp36m‑win_amd64.whl),cp后面是python版本,amd64代表64位,运行命令:
    pip install C:\Users\Administrator.GZLX--20160720J\Downloads\Twisted-18.9.0-cp36-cp36m-win_amd64.whl
    提示安装成功
Installing collected packages: Twisted
Successfully installed Twisted-18.9.0

7.再次运行pip install scrapy ,提示安装成功

Installing collected packages: scrapy
Successfully installed scrapy-1.5.2

8、安装windows环境依赖包pip install pypiwin32

你可能感兴趣的:(python)