Python version 2.7 required, which was wasn't found in the registry

Source: Internet
Author: User

Create a new register.py file, paste the code in, Save (G-disk)

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

## 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/[email  protected]/msg10512.html import sys from _winreg import * #  Tweak as necessaryversion = 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 ()

650) this.width=650; "src=" Http://common.cnblogs.com/images/copycode.gif "alt=" Copy Code "style=" margin:0px;padding:0px ; border:none; "/>

Enter the following command (register.py stored under G-disk)

650) this.width=650; "src=" Http://pic002.cnblogs.com/images/2012/370308/2012052400040771.png "style=" margin:0px; padding:0px;border:0px; "/>

Show "Python 2.7 is already registered"

When you install Setuptools, you can automatically identify the python2.7.

Win7 is 64 reasons, when installing Python (32-bit), if you choose only for the current user, the above problems will not appear, if you choose all users, then use the above method to solve it.


This article is from the "Mr_computer" blog, make sure to keep this source http://caochun.blog.51cto.com/4497308/1539320

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.