zoukankan      html  css  js  c++  java
  • win10 64位 安装scrapy

    在学习python时,不可避免下载了Anaconda,当我打算写爬虫时,urllib,requests,selenium,pyspider都已经安装好了,可以直接使用了,但是有一天我想要使用scrapy模块时,发现竟然没有安装,于是自己参照网上教程写下win64安装scrapy步骤:

    1.升级pip

    python -m pip install --upgrade pip

    2.安装wheel,有了wheel就可以离线安装各种模块了

    pip install wheel

    3.安装Twisted

    https://www.lfd.uci.edu/~gohlke/pythonlibs/中找到Twisted进行下载。

    像我这台机子又下python3.5又下了anaconda3,有时候会犯浑不知道自己要下载哪个版本的

    参照如下命令可以查看pip支持的安装包名:

    >>> import pip._internal
    >>> print(pip._internal.pep425tags.get_supported())
    [('cp36', 'cp36m', 'win_amd64'), ('cp36', 'none', 'win_amd64'), ('py3', 'none', 'win_amd64'), ('cp36', 'none', 'any'), ('cp3', 'none', 'any'), ('py36', 'none', 'any'), ('py3', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]

    如果是win32的话是如下命令:

    >>> import pip
    >>> print(pip.pep425tags.get_supported())

    好了,现在知道自己下载哪个版本的了,我下载了Twisted-18.9.0-cp36-cp36m-win_amd64.whl

    然后进行 pip install安装,这里有个技巧是,你直接输入pip install Twisted-18.9.0-cp36-cp36m-win_amd64.whl会提示找不到,要把这个wheel文件的属性安全里的文件路径copy下来,比如我是pip install C:UsersAdministratorDownloadsTwisted-18.9.0-cp36-cp36m-win_amd64.whl,这样就可以安装了。

    4.安装pypiwin32

    使用pip install pypiwin32,结果报错了

    Cannot uninstall 'pywin32'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

    发现原来anaconda已经有pywin32,按照道理来说会提示 Requirement already satisfied:XXX 之类的,但是这里没有。

    有问题问度娘,原来是anaconda/Lib/site-packages里有个pywin32-221-py3.6.egg-info在作妖,把这个文件删除就可以进行安装了。离线地址:https://pypi.org/project/pywin32/#files

    5.安装scrapy

    直接使用pip install scrapy命令,好使

    记得安装完后 import scrapy 进行验证

  • 相关阅读:
    解决Metasploit中shell乱码的问题
    AWVS扫描器的用法
    AWVS扫描器的用法
    AppScan扫描器的用法
    AppScan扫描器的用法
    Nessus扫描器的使用
    IPC$共享和其他共享(C$、D$)
    IPC$共享和其他共享(C$、D$)
    Windows中动态磁盘管理
    Windows中动态磁盘管理
  • 原文地址:https://www.cnblogs.com/triangle959/p/10662893.html
Copyright © 2011-2022 走看看