1. 程式人生 > >安裝mysql-connector-python-8.0.11-py3.6遇到問題

安裝mysql-connector-python-8.0.11-py3.6遇到問題

probably settings ssa {0} hat error span -s already

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/[email protected]/msg10512.html 11 # modified for Python 3 support by Erik Bray <[email protected]> 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()
View Code

安裝mysql-connector-python-8.0.11-py3.6遇到問題