Python registry function syntax
When installing NumPy under Windows, there was a "Python version 3.3 required, which was wasn't found in the registry" error.
Similar: Python version 2.7 required, which is not found in the registry
The general meaning is: The registry does not have the corresponding information. Just execute a python script and register HKEY_CURRENT_USER (HKCU) as well.
Version 2.7 can be referenced by: http://blog.csdn.net/zklth/article/details/8117207
Version 3.3 can be referenced by: https://gist.github.com/embray/6042780#file-win_register_python-py
Related instructions:
http://pythonhosted.org/pyfits/appendix/faq.html# On-windows-vista-or-later-why-can-t-the-installer-find-python-in-the-registry
Where the Python3 version can execute the following script:
From __future__ import print_function import sys try:from winreg import *except importerror:from _winreg Import * # tweak as Necessaryversion = Sys.version[:3]installpath = Sys.prefix Regpath = "software\\python\\pythoncore\\{0}\\". Fo Rmat (version) Installkey = "InstallPath" Pythonkey = "PythonPath" PythonPath = "{0}; {1}\\lib\\; {2}\\dlls\\ ". Format (InstallPath, InstallPath, InstallPath) def registerpy (): Try:reg = Openkey (hkey_curren T_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) Cl Osekey (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 ()
Reprint please come from a handbook: http://yishouce.com/article/62.html
Python version 3.3 required, which was wasn't found in the registry