Windows环境下python2.7安装mysql-python
2017-06-14 22:09
483 查看
下载并安装所需的vc包
当我们尝试用:pip install mysql-python #并不是MySQLdb
企图安装mysql时,我们会发现一开始进行的很顺利,但最后就会提示:
error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27[/code]
因此我们根据上面提供的网址下载VCforPython27
安装即可。安装驱动
当我们尝试再次运行pip install mysql-python的命令时,我们发现又出错了:No such file or directory error: command '"C:\Users\xxx\AppData\Local\Programs\Common\Microsoft\Visua l C++ for Python\9.0\VC\Bin\amd64\cl.exe"' failed with exit status 2
我们需要下载驱动:
64位:MySQL-python-1.2.3.win-amd64-py2.7.exe
32位: MySQL-python-1.2.5.win32-py2.7.exe
在安装时遇到以下问题:Python version 2.7 required, which was not found in the registry
具体可参考博客:解决安装MySQL-python出现的:Python version 2.7 required, which was not found in the registry安装成功
cmd命令行下执行:pip install mysql
提示安装成功:C:\Users\xxx>pip install mysql Collecting mysql Using cached mysql-0.0.1.tar.gz Requirement already satisfied: MySQL-python in c:\python27\lib\site-packages (from mysql) Building wheels for collected packages: mysql Running setup.py bdist_wheel for mysql ... done Stored in directory: C:\Users\刘常榕\AppData\Local\pip\Cache\wheels\3a\83\02\e5a659e28b517bff04eee83a5fed1f36761afe8d591835cd29 Successfully built mysql Installing collected packages: mysql Successfully installed mysql-0.0.1
在python命令行下输入:import MySQLdb
若无任何提示,则说明安装成功。
end
相关文章推荐
- Windows环境Python2.7安装Scipy
- Python+MySQL学习之路:一、为Windows下python2.7安装MySQLdb模块
- Windows 下python2.7安装MySQL-python插件遇到的问题
- Windows下Python环境、IDE、MySQL等安装教程
- Windows(64bit)下Python2.7环境安装paramiko模块
- Windows下python2.7安装64位mysqlclient
- python操作三大主流数据库(1)python操作mysql①windows环境中安装python操作mysql数据库的MySQLdb模块mysql-client
- Windows python2.7虚拟环境下的PyV8安装
- windows环境下python2.7、pycharm、numpy_mkl、scipy、sklearn、Matplotlib、jupyter完整安装教程
- windows 环境安装 MySQL-python 遇到错误 serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['regi
- windows平台python 2.7环境编译安装zbarlight
- windows环境配置:同时安装Python2.7和Python3.6开发环境
- windows下python2.7环境下nltk的安装
- windows下安装django(python2.7)并配置mysql
- windows环境下安装python2.7+PyQt5+eric6记录
- windows系统在python3.5环境下安装mysql组件
- Windows系统的Python2.7和Python3.5环境搭建以及Pycharm2017.1.1的安装,Mac的Pycharm下载
- Windows 7环境下的python2.7及python 3.6中的pip安装
- windows环境下python2.7、pycharm、numpy_mkl、scipy、sklearn、Matplotlib、jupyter完整安装教程
- windows平台python 2.7环境编译安装zbar