Linux system users when installing third-party libraries, suddenly prompted the error code Python version 2.7 required, which was not found in the registry, encountered this problem You can solve this problem by simply creating a script and executing it.
Create a file register.py follows. Then execute the script
The 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 = &ldquoquo ;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:
p Rint “*** 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()
The above is the solution for the Linux installation of third-party libraries, the above is the script The code, after executing the script and then installing the third-party library, will not appear error code.
mysql server prompts upgrade, many Linux users after upgrading mysql found always prompted conflict
The tee command in Linux is mainly used to save the data imported by the pipeline i
The most commonly used editor for Linux users is the VIM editor. In order to improve our editing spe
As a qualified Linux system administrator, it is necessary to constantly monitor th
How to back up web files under Linux
Linux system using additional permissions method
How to use the Linux system top command
Solution for unusable xmanager passive function under Linux
Linux how to use the text processing tool awk
Steps to install IEs4Linux on Ubuntu 12.04
How to Troubleshoot Malicious Outbox Behavior on Linux Servers
Linux uses commands to clear the terminal screen
Introduction to the syntax and parameters of the Linux system xlsclients command
Ubuntu 14.04 prohibits the apport error report window startup method
WinRAR can also manage my desktop
Win10 boot failure prompts "Your computer has a problem, need to restart" how to do
Control the computer through Bluetooth mobile phone under Vista
Win10 preview version 10022 download address win10 10022 official website download
Win10 Tips: Have to tell you 10 tips on Win10
Teach you to extend the endurance of Windows 8 notebooks
Solution for finding a progress bar window when upgrading Win10 11082 files