Python: How to install mysqldb on windows 7 x64?

后端 未结 3 1755
鱼传尺愫
鱼传尺愫 2021-02-02 13:31

Im trying install Mysql-python on windows x64.

I installed python x64, setuptools (checked on the

相关标签:
3条回答
  • 2021-02-02 13:54

    "Unable to find vcvarsall.bat" means that you haven't got the necessary Visual Studio directories in your path.

    However, if you are using 64 bit Python then you'll need a 64 bit compiler and Express doesn't come in 64 bit flavours. You could download the SDK MSVC compiler and get that configured but its very hard work.

    If I was you I'd switch to 32 bit Python and you can almost surely get pre-built binaries.

    EDIT

    Pre-built 64 bit binaries as found by piquadrat would be even simpler!

    0 讨论(0)
  • 2021-02-02 14:07

    EDIT: mysqlclient has binary packages for both 32bit and 64bit on PyPI. It's a fork of MySQL-python, which hasn't seen a release since 2014.

    Original answer left for posterity:

    You can find binary installers here (Python 2.6-3.2), here (2.7) or here (2.6). Note that you don't have to use 64bit Python on Windows x64. You can just as well use a 32bit build of Python, for which there are more pre-built 3rd party packages around.

    0 讨论(0)
  • 2021-02-02 14:09

    I'm not 100% sure, but I think your path variables are to blame. It seems the compiler isn't found, run a search for vcvarsall.bat and double click it, it should correctly set your path variables. And then try to install again your package. If you can't find vcvarsall.bat, reinstall MS Visual Express again.

    0 讨论(0)
提交回复
热议问题