Cannot import MySQLdb - python - Windows 8.1

蓝咒 提交于 2019-12-06 21:25:28

Issue resolved. I dint have a C compiler / Visual Studio in my laptop - This link might help http://mysql-python.blogspot.com/2012/11/is-mysqldb-hard-to-install.html I installed MinGW - http://sourceforge.net/projects/mingw/?source=typ_redirect Selected the c++ option

I uninstalled Anaconda, Python and Installed anaconda again. So python 2.7.7 got installed along with Anaconda. Did a conda init,

conda install pip 

pip install mysql-python

and then import MySQLdb

No Error!! Hope this helps!!

====================================================================

Update - Jan 2, 2015

If you want to try installing mysql-python package using conda instead of pip, you can try the following, which worked for me.

conda install binstar

binstar search -t conda mysql-python

This will show you 10 different packages for different OS. krisvanneste mysql-python is for Win-64

To know more about this package use the command

 binstar show krisvanneste/mysql-python

This will show you the command to install the mysql-python package which happens to be

conda install --channel https://conda.binstar.org/krisvanneste mysql-python

This will install the required package. Now trying import MySQLdb in python wont throw error.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!