zoukankan      html  css  js  c++  java
  • python3 安装 MySQL-python

    如果打算用python与MySQL数据库进行交互,当然是需要安装第三方库MySQL-python的。如果直接用pip安装,通常会报出一个错误:python.h找不到,这是因为有一些依赖没有装上。

    安装依赖(仅限Ubuntu):apt-get install libmysqlclient-dev libmysqld-dev python-dev python-setuptools。

    之后安装MySQL-python:pip install MySQL-python。

    更正:以上主要支持python2,MySQL-python是不支持python3的,如果python3中想要利用MySQL的python接口,需要另一套安装方法。

    sudo apt-get install python3-dev libmysqlclient-dev

    pip install mysqlclient。

    这个库也是很好用的,亲测有效。
    ————————————————
    版权声明:本文为CSDN博主「qiweiqian」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/qiweiqian/article/details/79692891

  • 相关阅读:
    test20180922 倾斜的线
    test20180921 量子纠缠
    test20180921 手机信号
    test20180919 选择客栈
    BZOJ3083 遥远的国度
    test20180907 day1
    [ZJOI2010]基站选址
    HDU3584 Cube
    POJ2155 Matrix
    test20180902 day1
  • 原文地址:https://www.cnblogs.com/chengfengchi/p/12157661.html
Copyright © 2011-2022 走看看