Python version 2.7 Required,which is not found in the registry

Source: Internet
Author: User

When installing pil-1.1.7.win32-py2.7, you can no longer recognize it in the registration form python2.7

Method: Create a new file, paste the code in, save

# # Script to register Python 2.0 or later-win32all# and other extensions that require Python registry setting s## written by Joakim Loew for Secret Labs ab/pythonware## source:# gpy20.htm## modified by Valentine Gogichashvili as described in[email protected]/ msg10512.html Import sys from _winreg import * # tweak as Necessaryversion = Sys.version[:3]installpath = Sys.prefix Regpa th = "software\\python\\pythoncore\\%s\\"% (version) Installkey = "InstallPath" Pythonkey = "PythonPath" PythonPath = "%s; %s\\lib\\;%s\\dlls\\ "% (InstallPath, InstallPath, InstallPath) def registerpy (): Try:reg = Openkey (HKEY_CU            Rrent_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): Clos        EKey (reg) print "= = = Python", version, "is already registered!"    Return Closekey (REG) Print "* * * Unable to register!" Print "* * * you probably has another Python installation!" if __name__ = = "__main__": Registerpy ()

(Code from:

Show "Python 2.7 is now 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.

Python version 2.7 Required,which is not found in the registry

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