日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python version 3.4 required_Python version 3.3 required, which was not found in the registry

發布時間:2025/6/17 python 51 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python version 3.4 required_Python version 3.3 required, which was not found in the registry 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

在windows下安裝numpy的時候,?出現了"Python version 3.3 required, which was not found in the registry"的錯誤.

類似的有:Python version 2.7 required, which was not found in the registry

大致意思是說:注冊表沒有對應的信息. 只要執行一個python腳本,將HKEY_CURRENT_USER?(HKCU)注冊就好.

2.7版本的可以參照:?http://blog.csdn.net/zklth/article/details/8117207

3.3版本的可以參照:?https://gist.github.com/embray/6042780#file-win_register_python-py

相關的說明:

http://pythonhosted.org/pyfits/appendix/faq.html#on-windows-vista-or-later-why-can-t-the-installer-find-python-in-the-registry

其中python3版本的可以執行以下腳本:

from __future__ import print_function

import sys

try:

from winreg import *

except ImportError:

from _winreg import *

# tweak as necessary

version = sys.version[:3]

installpath = sys.prefix

regpath = "SOFTWARE\\Python\\Pythoncore\\{0}\\".format(version)

installkey = "InstallPath"

pythonkey = "PythonPath"

pythonpath = "{0};{1}\\Lib\\;{2}\\DLLs\\".format(

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("*** 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()

轉載請來自一手冊:http://yishouce.com/article/62.html

總結

以上是生活随笔為你收集整理的python version 3.4 required_Python version 3.3 required, which was not found in the registry的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。