Download and install scrapy

Tell me I'm not a person is dead pit installed scrapy

Installation scrapy

python3.7 ,win10

1, download the wheel, twisted both of which I was setting the download directly pycharm

Download pywin32

1, I use pycharm pywin32 installation does not work and can only go to the official website to download the corresponding version python3.7, download pywin32 placed under the python's site-packages file

2, pywin32 Download: https://sourceforge.net/projects/pywin32/files/pywin32/Build%20221/

3, installation pywin32 been next, but I get the following error when reported and resolved as follows:

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

Resolve the above error, create a new file register.py, and put him and pywin32 in the same directory, posted at the following code:

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()

After saving enter cmd, switch to the directory to store the py file, execute python registed.py to re-run the exe file to install pywin32.

Download scrapy with pytcharm

1, the downloaded file is Scrapy I put his hand into scrapy, scrapy-1.7.3.dist-info

2, the configuration environment variable path scrapy

Guess you like

Origin www.cnblogs.com/venvive/p/11682116.html