1.提示“This application requires Visual Studio 2015 Redistributable”
下载vc_redist.x86安装即可。
下载链接:https://download.microsoft.com/download/6/D/F/6DF3FF94-F7F9-4F0B-838C-A328D1A7D0EE/vc_redist.x86.exe
https://download.microsoft.com/download/0/6/4/064F84EA-D1DB-4EAA-9A5C-CC2F0FF6A638/vc_redist.x64.exe
2.提示 “Python v3.6 not found”
第一种情况,是真的没装3.6版本。下载安装即可
第二种情况,电脑是64位装成了32位。看仔细
第三种情况,以前装过Python2.7或者其他版本,没卸载干净,又装了更高级版本。运行以下py代码更新注册表信息即可
1 # 2 # script to register Python 2.0 or later for use with win32all 3 # and other extensions that require Python registry settings 4 # 5 # written by Joakim Loew for Secret Labs AB / PythonWare 6 # 7 # source: 8 # http://www.pythonware.com/products/works/articles/regpy20.htm 9 # 10 # modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html 11 # modified for Python 3 support by Erik Bray <erik.m.bray@gmail.com> 12 13 from __future__ import print_function 14 15 16 import sys 17 18 try: 19 from winreg import * 20 except ImportError: 21 from _winreg import * 22 23 # tweak as necessary 24 version = sys.version[:3] 25 installpath = sys.prefix 26 27 regpath = "SOFTWARE\\Python\\Pythoncore\\{0}\\".format(version) 28 installkey = "InstallPath" 29 pythonkey = "PythonPath" 30 pythonpath = "{0};{1}\\Lib\\;{2}\\DLLs\\".format( 31 installpath, installpath, installpath) 32 33 34 def RegisterPy(): 35 try: 36 reg = OpenKey(HKEY_CURRENT_USER, regpath) 37 except EnvironmentError as e: 38 try: 39 reg = CreateKey(HKEY_CURRENT_USER, regpath) 40 SetValue(reg, installkey, REG_SZ, installpath) 41 SetValue(reg, pythonkey, REG_SZ, pythonpath) 42 CloseKey(reg) 43 except: 44 print("*** Unable to register!") 45 return 46 print("--- Python", version, "is now registered!") 47 return 48 if (QueryValue(reg, installkey) == installpath and 49 QueryValue(reg, pythonkey) == pythonpath): 50 CloseKey(reg) 51 print("=== Python", version, "is already registered!") 52 return 53 CloseKey(reg) 54 print("*** Unable to register!") 55 print("*** You probably have another Python installation!") 56 57 if __name__ == "__main__": 58 RegisterPy()