Linux安拆第三圆库时报错Python version 2.7怎样办?

相关游戏 相关文章 发表评论字体大小:【 | |

作者:佚名 2020-01-03 来源:本站整理    浏览:2     评论:0 条

  Linux体系用户正在装置第三圆库的时分,忽然提示谬误代码Python version 2.7 required,which was not found in the registry,逢到那个答题的时分您只需建设一个剧本并执止,便可处理那个答题。

Linux安拆第三圆库时报错Python version 2.7怎样办?

  建设一个文件 register.py 内容以下。 而后执止该剧本

  代码以下

  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 “AV女优 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 “AV女优 Unable to register!”

  print “AV女优 You probably have another Python installation!”

  if __name__ == “__main__”:

  RegisterPy()

  下面便是Linux装置第三圆库报错的处理要领了,上文便是该剧本的代码,执止剧本后再装置第三圆库便没有会呈现谬误代码了。

这些是你想要的吗?

相关游戏

网友评论

评论需审核后才能显示