Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
When you install python for all user, this problem will occurs, if you select install python for current, there is no issue. Save this file in your D disk for example, go to cmd run 'python', then you will be able to install easy_install then go to C:\Python27\Scripts run easy_install.exe -U bottle
# 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:
# modified by Valentine Gogichashvili as described in
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():
reg = OpenKey(HKEY_CURRENT_USER, regpath)
except EnvironmentError as e:
reg = CreateKey(HKEY_CURRENT_USER, regpath)
SetValue(reg, installkey, REG_SZ, installpath)
SetValue(reg, pythonkey, REG_SZ, pythonpath)
print "*** Unable to register!"
print "--- Python", version, "is now registered!"
if (QueryValue(reg, installkey) == installpath and
QueryValue(reg, pythonkey) == pythonpath):
print "=== Python", version, "is already registered!"
print "*** Unable to register!"
print "*** You probably have another Python installation!"
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment