安装PIL-1.1.7.win32-py2.7的时候,不能再注册表中识别出来python2.7

方法:新建一个register.py 文件,把一下代码贴进去,保存

  1. #
  2. # script to register Python 2.0 or later for use with win32all
  3. # and other extensions that require Python registry settings
  4. #
  5. # written by Joakim Loew for Secret Labs AB / PythonWare
  6. #
  7. # source:
  8. # http://www.pythonware.com/products/works/articles/regpy20.htm
  9. #
  10. # modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html
  11.  
  12. import sys
  13.  
  14. from _winreg import *
  15.  
  16. # tweak as necessary
  17. version = sys.version[:3]
  18. installpath = sys.prefix
  19.  
  20. regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)
  21. installkey = "InstallPath"
  22. pythonkey = "PythonPath"
  23. pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % (
  24. installpath, installpath, installpath
  25. )
  26.  
  27. def RegisterPy():
  28. try:
  29. reg = OpenKey(HKEY_CURRENT_USER, regpath)
  30. except EnvironmentError as e:
  31. try:
  32. reg = CreateKey(HKEY_CURRENT_USER, regpath)
  33. SetValue(reg, installkey, REG_SZ, installpath)
  34. SetValue(reg, pythonkey, REG_SZ, pythonpath)
  35. CloseKey(reg)
  36. except:
  37. print "*** Unable to register!"
  38. return
  39. print "--- Python", version, "is now registered!"
  40. return
  41. if (QueryValue(reg, installkey) == installpath and
  42. QueryValue(reg, pythonkey) == pythonpath):
  43. CloseKey(reg)
  44. print "=== Python", version, "is already registered!"
  45. return
  46. CloseKey(reg)
  47. print "*** Unable to register!"
  48. print "*** You probably have another Python installation!"
  49.  
  50. if __name__ == "__main__":
  51. RegisterPy()

按F5执行即显示:

  1. >>> ================================ RESTART ================================
  2. >>>
  3. === Python 2.7 is already registered!
  4. >>>

显示“python 2.7 is already registered”

再安装setuptools的时候,就能自动识别出来python2.7了。

win7是 64的原因,在安装python(32位)时,如果选择只为当前用户,以上问题是不会出现的,如果选择所有用户,那就用上面的方法解决吧。

<转>python version 2.7 required,which was not found in the registry的更多相关文章

  1. 【转】安装第三方库出现 Python version 2.7 required, which was not found in the registry

    安装第三方库出现 Python version 2.7 required, which was not found in the registry 建立一个文件 register.py 内容如下. 然 ...

  2. Python 安装Twisted 提示python version 2.7 required,which was not found in the registry

    由于我安装Python64位的,下载后没注册,安装Twisted时老提示“python version 2.7 required,which was not found in the registry ...

  3. 安装第三方库出现 Python version 2.7 required, which was not found in the registry

    安装第三方库出现 Python version 2.7 required, which was not found in the registry 建立一个文件 register.py 内容如下. 然 ...

  4. 【亲测】Python:解决方案:Python Version 2.7 required, which was not found in the registry

    好久不更新随笔了,今天因为数据可视化作业,想抓取一些人人网好友关系数据,于是开始尝试python,用到numpy模块,安装的时候提示: 'Python Version 2.7 required, wh ...

  5. 96、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 ...

  6. 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 ...

  7. Python version 3.6 required, which was not found in the registry错误解决

    问题: 安装pywin32出现Python version 3.6 required, which was not found in the registry错误解决 解决: 建立一个文件 regis ...

  8. 安装pywin32出现--Python version 3.x required, which was not found in the registry

    这两天安装pywin32时出现了这个问题 双击.exe文件进入安装界面,然后点击下一步,它会自动定位你的python安装在什么地方,但是我的安装过程中未自动定位到python安装位置,并显示显示: 安 ...

  9. 安装 pywin32-218.win32-py2.7.exe 报错python version 2.7 required,which was not found in the registry解决方案

    随便在一个盘下 新建register.py的文件,内容如下: #   # script to register Python 2.0 or later for use with win32all    ...

随机推荐

  1. Eclipse通过集成svn实现版本控制

    Eclipse通过集成svn即安装subclipse插件 前面已经讲解过了,这就不说了,作为测试人员继续总结下Eclipse通过集成svn实现的版本控制 首次从SVN代码库中导出代码文件: 1.右键工 ...

  2. cygwin如何断点续传

    对于Cygwin,如果想安装的东西比较多的话,推荐先选择“Download without installing”,下载完了再从本地安装. 好了,说关于断点续传.我所知道的是—— 网上有说法:下载失败 ...

  3. 用 EasyBCD 在 Win7/8 中硬盘安装 Ubuntu

    写在前面: 1. 我装的是ubuntu 13.10 64位,不一样的地方是,从casper文件夹复制出来的文件不是vmlinuz,而是vmlinuz.efi,相应的,menu.lst里也要将vmlin ...

  4. 转一个distinct用法,很有帮助

    转一个distinct用法,很有帮助 (2011-12-01 15:18:11) 转载▼ 标签: 杂谈 分类: mysql复制 在使用mysql时,有时需要查询出某个字段不重复的记录,虽然mysql提 ...

  5. s.charAt()

    public class ish{public static void main(String[]args){ String s="call me ishmae";System.o ...

  6. for each

    public class ArrayForeach{ public static void main(String []args){ int [][]a={{1,2,3},{4,5,6},{7,8,9 ...

  7. 64位下好神奇啊(增加了PatchGuard技术保护自己,SSDT是相对地址,参数通过寄存器与rdi来传递)

    近期可能会有一个64位平台的驱动开发任务,找了些资料,对64位平台下的驱动开发略知一二了,好神奇. 一.在64位系统下,有一项PatchGuard技术,它是微软为了防止自己的代码被Patch,进而影响 ...

  8. 在PowerDesigner中设计概念模型

    原文:在PowerDesigner中设计概念模型 在概念模型中主要有以下几个操作和设置的对象:实体(Entity).实体属性 (Attribute).实体标识(Identifiers).关系(Rela ...

  9. iOS Objective-C对象模型及应用

    前言 原创文章,转载请注明出自唐巧的技术博客. 本文主要介绍Objective-C对象模型的实现细节,以及Objective-C语言对象模型中对isa swizzling和method swizzli ...

  10. 整理了一份招PHP高级工程师的面试题

    1. 基本知识点 HTTP协议中几个状态码的含义:1xx(临时响应) 表示临时响应并需要请求者继续执行操作的状态代码. 代码   说明 100   (继续) 请求者应当继续提出请求. 服务器返回此代码 ...