Home  >  Q&A  >  body text

macos - MAC下配置mysql-python 遇见的问题

MBP上安装了XMAPP 准备再装一个mysql-python 搭建python web开发环境,下载了mysql-python文件,网上搜了各种方法,修改了文件,然后键入 sudo python setup.py install 后,python里面键入import MySQLdb 出现以下问题:

大家讲道理大家讲道理2720 days ago433

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-04-17 13:18:11

    mysql-python needs to be installed locally mysql. The xmapp and mysql in the mysql-python you installed may not have found the correct configuration.

    If it is not a production environment, use mysql-connector instead. This is the mysqlofficially recommended driver and is purely pythonimplemented. No need to configure local mysql locally. The usage is the same as mysqldb.

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 13:18:11

    mysql-python is just a module of python language using mysql.
    Before using mysql-python, you must first install the mysql for mac version.

    reply
    0
  • Cancelreply