安装mysql-connector-python-8.0.11-py3.6遇到问题

Posted zz测试

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装mysql-connector-python-8.0.11-py3.6遇到问题相关的知识,希望对你有一定的参考价值。

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遇到问题的主要内容,如果未能解决你的问题,请参考以下文章

安装python官方的mysql库“mysql-connector-python”

pip install mysql-connector-python 安装错误

安装mysql-connector-python-8.0.11-py3.6遇到问题

找不到任何满足 mysql-connector-python 要求的下载

无法在 virtualenv 中安装 mysql-connector-python

MySQL数据库原理Python3.7 中连接 MySQL 数据库