zoukankan      html  css  js  c++  java
  • 下载安装scrapy

    告诉我我不是一个人被安装scrapy坑死

    安装scrapy

    python3.7 ,win10

    1、下载wheel,twisted这两个我是直接用pycharm的setting下载的

    下载pywin32

    1、我使用pycharm安装pywin32不起作用只能去官网下载与python3.7对应的版本,下载的pywin32放在python的site-packages文件下

    2、pywin32下载: https://sourceforge.net/projects/pywin32/files/pywin32/Build%20221/

    3、安装pywin32一直next,但是我弄的时候报了如下错并解决如下:

        -Python version 3.7 required, which was not found in the registry
    

    解决上面的错误,新建一个文件register.py,并把他和pywin32在同一个目录下,贴下如下代码:

    from __future__ import print_function
     
     
    import sys
     
    try:
        from winreg import *
    except ImportError:
        from _winreg import *
     
    # tweak as necessary
    version = sys.version[:3]
    installpath = sys.prefix
     
    regpath = "SOFTWARE\Python\Pythoncore\{0}\".format(version)
    installkey = "InstallPath"
    pythonkey = "PythonPath"
    pythonpath = "{0};{1}\Lib\;{2}\DLLs\".format(
        installpath, installpath, installpath)
     
     
    def RegisterPy():
        try:
            reg = OpenKey(HKEY_CURRENT_USER, regpath)
        except EnvironmentError as e:
            try:
                reg = CreateKey(HKEY_CURRENT_USER, regpath)
                SetValue(reg, installkey, REG_SZ, installpath)
                SetValue(reg, pythonkey, REG_SZ, pythonpath)
                CloseKey(reg)
            except:
                print("*** Unable to register!")
                return
            print("--- Python", version, "is now registered!")
            return
        if (QueryValue(reg, installkey) == installpath and
            QueryValue(reg, pythonkey) == pythonpath):
            CloseKey(reg)
            print("=== Python", version, "is already registered!")
            return
        CloseKey(reg)
        print("*** Unable to register!")
        print("*** You probably have another Python installation!")
     
    if __name__ == "__main__":
        RegisterPy()
    

    保存之后进入cmd,切换到存储该py文件的目录,执行python registed.py即可重新运行exe文件进行pywin32的安装。

    用pytcharm下载scrapy

    1、下载的文件是Scrapy我把他手动改成scrapy,scrapy-1.7.3.dist-info

    2、配置环境变量把scrapy的路径

  • 相关阅读:
    Windows2012下安装和配置Oracle BIEE12c
    Windows Oracle 12安装教程
    SpringCloud学习之Ribbon使用(四)
    SpringCloud学习之手把手教你用IDEA搭建入门项目(三)
    SpringCloud学习之手把手教你用IDEA搭建入门项目(二)
    SpringCloud学习之手把手教你用IDEA搭建入门项目(一)
    SpringCloud学习之手把手教你用IDEA搭建入门项目【番外篇】(一)
    SpringCloud学习之大纲总略(大纲篇)
    Websocket @serverendpoint 404
    XMLHttpRequest status为0
  • 原文地址:https://www.cnblogs.com/venvive/p/11682116.html
Copyright © 2011-2022 走看看