日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

Python version 2.7 required, which

系統 2153 0

安裝PIL庫的時候,直接提示:Python version 2.7 required, which was not found in the registry。
如圖:

Python version 2.7 required, which was not found in the registry_第1張圖片

大意是說找不到注冊表,網上搜索解決方案。

新建一個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 "*** 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!"

啟動命令切到register.py文件目錄下執行:

重新安裝PIL,錯誤解決,安裝成功。

如果是win7 64位的用戶在安裝Python 32位程序時,如果選擇只為當前用戶,以上問題不會出現。如果選擇所有用戶,就試著使用以上方法解決。

提示其它版本解決方法類似。


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 淮南市| 盐亭县| 林周县| 始兴县| 长丰县| 万源市| 崇州市| 邢台市| 福海县| 壤塘县| 德钦县| 德兴市| 博客| 潮州市| 新干县| 辛集市| 南漳县| 正定县| 成武县| 凤翔县| 金湖县| 恩施市| 申扎县| 定日县| 洮南市| 肥城市| 台南市| 大埔区| 牡丹江市| 明光市| 庆云县| 彭泽县| 顺平县| 青河县| 忻城县| 张家港市| 长子县| 德令哈市| 禹城市| 铜川市| 荣成市|