window7系统下安装scrapy爬虫框架

本文是在python3.6环境下安装的下面软件,如果大家和我的python版本不一致,请在页面选择符合自己版本的软件下载.

1.wheel

pip install wheel

1445976-20190125193749597-1906496201.png

2.lxml

下载lxml文件:https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml

1445976-20190125194108151-661216821.png

下载完成,鼠标右击文件-属性-安全-复制文件路径

1445976-20190125194446737-1232801905.png
1445976-20190125194629742-1008369626.png

pip install C:\Users\Administrator\Desktop\lxml-4.2.6-cp36-cp36m-win_amd64.whl

打开cmd命令行

1445976-20190125194545179-440828349.png

3.PyOpenssl

下载文件pyOpenSSL

https://pypi.org/project/pyOpenSSL/#files

1445976-20190125194815017-1971698036.png

安装

1445976-20190125194855391-445332637.png

4.Twisted

下载文件

https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted

安装

1445976-20190125194931888-1647515428.png

5.Pywin32

下载文件pywin32

https://sourceforge.net/projects/pywin32/files/pywin32/Build%20220/

1445976-20190125202437317-707946808.png

安装

1445976-20190125195547542-1524677826.png

6.Scrapy

pip install scrapy

7.番外篇

7.1如果遇到下面的问题

1445976-20190125202543244-713259395.png

7.2请编写一个文件register.py,内容如下:

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

1445976-20190125202721286-657347645.png

7.3 复制python文件路径

1445976-20190125202936359-790223510.png

7.4 cmd窗口执行python文件

1445976-20190125203049529-476972471.png

7.5 重新执行pywin32-220.win32-py3.6.exe

8.相关文件百度网盘下载地址:

链接:https://pan.baidu.com/s/1RmtuVywW_mXs76_usU0sjA 
提取码:uakt 

转载于:https://www.cnblogs.com/apollo1616/p/10321534.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值