Python version 2.7 required, which was not found in the Registry

Source: Internet
Author: User

You cannot identify python2.7 in the Registry when installing setuptools.

I found a method on the Internet and only took notes for the next use.

 

Method:

 

Create a new register. py file and clickCodePaste in, save (G disk)

 

 ##  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 () 

 

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

 

Show "Python 2.7 is already registered"

When you install setuptools, You can automatically identify python2.7.

Windows 7 is 64. When installing Python (32-bit), if you select only the current user, the above problems will not occur. If you select all users, use the above method to solve the problem.

 

Code from: http://tech.valgog.com/2010/01/after-installing-64-bit-windows-7-at.html

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.