python version 3.6 required,which was not fount in the registry(python3.6安装scrapy)

在安装scrapy时遇到问题

环境:win10(64位), Python3.6(64位)

安装scrapy:

1、安装wheel(安装后,便支持通过wheel文件安装软件

pip3 install wheel

2、安装lxml、pyopenssl

lxml:解析XML的库,很强大,做爬虫BS4,selenium,XPATH都会用到

pip3 install lxml
pip3 install pyopenssl

3、安装pywin32

下载网址: https://sourceforge.net/projects/pywin32/files/pywin32/

根据自己python版本下载64位或32位((注意:pywin32版本跟随Python版本,即如果win是64位,但python是32位,pywin32要装32位的,与win无关))

双击安装(可能会遇到下列错误是注册表问题)

安装第三方库出现Python version 3.6 required, which was not found in the registry错误解决

建立一个文件 register.py 内容如下. 然后执行该脚本. 

import sys

from winreg import *

# tweak as necessary
version = sys.version[:3]
installpath = sys.prefix

regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)
installkey = "InstallPath"
pythonkey = "PythonPath"
pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % (
    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()

4、下载twisted

下载twisted的wheel文件:http://www.lfd.uci.edu/~gohlke/pythonlibs/

pip3 install 下载目录\Twisted-17.9.0-cp36-cp36m-win_amd64.whl

安装可能会报错

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

说明电脑需要安装visual C++ Build Tools 2015

5、安装scrapy

pip3 install scrapy

6、大功告成

 

这是今天安装scrapy时遇到的问题 明天会发一篇关于scrapy的详细随笔有兴趣的可以关注

 

转载于:https://www.cnblogs.com/liluning/p/8338219.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值