Compiling mysql-python on Windows with PIP

╄→гoц情女王★ 提交于 2019-12-05 00:18:41

I had the same problem and exact same errors.I don't know why but

pip install Mysql-python

gave errors. But when I tried

easy_install Mysql-python

It worked.I don't know why but it did work but would love to know why.

Check that both are either 32bit or 64bit, and you don't have a mismatch between them. When I had this problem, it was because I installed a 64bit Python but had a 32bit MySQL installed. The pip installer could therefore not find matching binaries to link to, and failed with this message. Fixing the problem was simply a matter of installing the 32bit Python over the top, and everything worked.

Note that it may also be possible to update MySQL to 64bit, but installers at the moment for MySQL appear to be 32bit only. You can install via a .zip file downloaded from the official MySQL site though that has 64bit binaries in it.

To find out which you have installed:

  • For Python, simply go to the command line and type in python. It should show you what version and if it was a 32bit or 64bit install like so

    Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32

  • For MySQL, the easiest way will likely be which folder it is installed in. If it installs to Program Files/ then it is 64bit, but if it installs to Program Files (x86)/ it is 32bit

This seems like your installation don't detect the mysql client library. Find and copy mysqlcppconn.dll from your mysql installation to a folder which is read by the build script, for example the windows folder. For more information check out this link https://dev.mysql.com/doc/connector-cpp/en/connector-cpp-apps-windows-visual-studio.html#connector-cpp-application-build-dynamic

I tried this and it worked for me on Win7 64 bit instalation of anaconda. type this into your command prompt:

pip install mysql-python

My installation works because i am using Studio 2010.

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