Python version 2.7 required, which was not found in the registry, pythonrequired
When installing the PIL library, you will be prompted: Python version 2.7 required, which was not found in the registry.
The general idea is that you cannot find the registry and search for a solution online.
Create a new register. py file and write the code:
Copy codeThe Code is as follows:
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 t 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 t:
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! "
Run the following command to switch to the register. py directory:
Reinstall PIL. The installation is successful.
If you select only the current user when installing the Python 32-bit program for Windows 7 64-bit users, the above problems will not occur. If you select all users, try the above solution.
The solution for other versions is similar.
When python version 27 required or which was not found in the registry occurs during software installation, how can this problem be solved? Diagram
You must first download and install python2.7,
Python installation Tool error no python installation found in the registry
Reinstall python.
The error message indicates that python is not found.