当前位置:首页 > Python教程 > python技巧

安装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/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 *
20except ImportError:
21from _winreg import *
2223# tweak as necessary24 version = sys.version[:3]
25 installpath = sys.prefix
2627 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)
323334def RegisterPy():
35try:
36         reg = OpenKey(HKEY_CURRENT_USER, regpath)
37except EnvironmentError as e:
38try:
39             reg = CreateKey(HKEY_CURRENT_USER, regpath)
40            SetValue(reg, installkey, REG_SZ, installpath)
41            SetValue(reg, pythonkey, REG_SZ, pythonpath)
42            CloseKey(reg)
43except:
44print("*** Unable to register!")
45return46print("--- Python", version, "is now registered!")
47return48if (QueryValue(reg, installkey) == installpath and49         QueryValue(reg, pythonkey) == pythonpath):
50        CloseKey(reg)
51print("=== Python", version, "is already registered!")
52return53    CloseKey(reg)
54print("*** Unable to register!")
55print("*** You probably have another Python installation!")
5657if__name__ == "__main__":
58     RegisterPy()
View Code

 

 

 

 

原文:https://www.cnblogs.com/jeane/p/9728679.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐