Windows 10 环境下python2.7 安装 mysql-python

在Windows 10环境中,使用Python 2.7安装mysql-python模块时遇到问题,首先尝试通过pip2安装MySQLdb失败,然后下载相应位数的MySQL-python安装文件,解决注册表识别Python 2.7的问题,成功安装后通过pip2确认安装,并在Python IDLE中验证导入MySQLdb无误,从而完成安装。
摘要由CSDN通过智能技术生成

环境:
Windows 10
Python 2.7
需要安装mysql-python相关模块

C:\Python27\Scripts>pip2 install MySQLdb
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
Collecting MySQLdb
Could not find a version that satisfies the requirement MySQLdb (from versions: )
No matching distribution found for MySQLdb
发现并不是 MySQLdb,而是mysql .

于是 需要下载驱动:
64位: MySQL-python-1.2.3.win-amd64-py2.7.exe
32位: MySQL-python-1.2.5.win32-py2.7.exe

在安装时遇到以下问题:
安装MySQL-python-1.2.3.win-amd64-py2.7.exe,时提示:Python version 2.7 required, which was not found in the registry
这是在注册表不能识别python2.7,原因windows是64位,安装的python是32位
备注: MySQLdb for python (32/64位)下载;http://www.co

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值