zoukankan      html  css  js  c++  java
  • windows下python操作mysql模块安装

    百度教程说安装

    pip install mysqldb

    这在我的电脑上安装失败:

      Could not find a version that satisfies the requirement mysqldb (from versions
    : )
    No matching distribution found for mysqldb

    所以应该:

    pip install MySQL-python

    报错:

    error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat).
    Get it from http://aka.ms/vcpython27

    缺少vc的一个库,我们根据提示到这里下载一下,然后安装,再次执行命令 :pip install mysql-python

    还是报错:

    No such file or directory
        error: command '"C:Users年浩AppDataLocalProgramsCommonMicrosoftVisua
    l C++ for Python9.0VCBinamd64cl.exe"' failed with exit status 2

    这是因为缺少驱动。

    MySQL-python-1.2.3.win-amd64-py2.7.exe

    给两个下载地址:http://download.csdn.net/detail/weibin0320/6663763

    或者:http://www.jb51.net/softs/73369.html#download

    安装后再次执行install 命令。ok,没有报错。我们测试一下。

    import MySQLdb

    没有报错,安装成功。。



  • 相关阅读:
    netcore 报错 502 缺少运行时
    简单工厂模式
    net之-------状态模式
    pc端字体正常, 缩放浏览器正常,手机模式查看出问题
    我的后续情况
    [wip]Berty
    利用FileReader对象回显图片
    测试
    CMP云管平台竞标产品
    nacos spring cloud
  • 原文地址:https://www.cnblogs.com/superxuezhazha/p/6619036.html
Copyright © 2011-2022 走看看