随便在一个盘下 新建register.py的文件,内容如下:

#   
# script to register Python 2.0 or later for use with win32all   
# and other extensions that require Python registry settings   
#   
# written by Joakim Loew for Secret Labs AB / PythonWare   
#   
# source:   
# http://www.pythonware.com/products/works/articles/regpy20.htm   
#   
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html   
   
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()  

然后执行此文件

然后即可正常安装了

最新文章

  1. 怎样用conda安装opencv
  2. maven配置发布仓库
  3. 【转载】jquery validate验证插件,在ajax提交方式下的验证
  4. unity, 播放循环背景音乐注意事项
  5. 周赛-Killing Monsters 分类: 比赛 2015-08-02 09:45 3人阅读 评论(0) 收藏
  6. Codeforces Round #376 (Div. 2) C. Socks bfs
  7. IAR EWARM Argument variables $PROJ_DIR$ $TOOLKIT_DIR$
  8. Wildfly8 更改response header中的Server参数
  9. FormsCookieName保存登录用户名的使用
  10. socket字符流循环截取
  11. 2019年IntelliJ IDEA 最新注册码,亲测可用(截止到2020年3月11日)
  12. excel VBA动态链接数据库
  13. github同一账户+多个库
  14. php7 安装swoole4.0.4
  15. LDAP属性对照表
  16. 架构师养成记--24.linux常用命令
  17. Python3 面向对象编程高级语法
  18. What happens when a SQL Query runs?
  19. NumPy IO文件操作
  20. 数据库学习(二) case when then else end 的使用

热门文章

  1. 引入DecimalFormat类进行数字格式化操作
  2. Cheat sheets
  3. 成功开发iPhone软件的10个步骤
  4. Spring4读书笔记(2)- 使用场景
  5. css负边距之详解
  6. Windows Defender无法开启问题
  7. Markdown精简版个人语法
  8. BZOJ 2083: [Poi2010]Intelligence test
  9. java大并发数据保存方案
  10. 在ashx文件中制作验证码(使用session要继承IRequiresSessionState)