安装mysql驱动遇到的问题怎么解决

来源:3-2 配置表单页面

Kaiz不是

2016-12-25

Collecting mysql-python

  Downloading MySQL-python-1.2.5.zip (108kB)

    100% |████████████████████████████████| 112kB 12kB/s 

    Complete output from command python setup.py egg_info:

    sh: mysql_config: command not found

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "/tmp/pip-build-cFNPQp/mysql-python/setup.py", line 17, in <module>

        metadata, options = get_config()

      File "setup_posix.py", line 43, in get_config

        libs = mysql_config("libs_r")

      File "setup_posix.py", line 25, in mysql_config

        raise EnvironmentError("%s not found" % (mysql_config.path,))

    EnvironmentError: mysql_config not found


    

    ----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-cFNPQp/mysql-python/


写回答

2回答

bobby

2017-02-23

sudo apt-get install libmysqlclient-dev   (如果你用的maridb 运行 sudo apt-get install libmariadbclient-dev)

0
3
bobby
回复
江魁
第一种方法 你试试 pip install mysqlclient 如果还是不行 你看看这篇文章 http://stackoverflow.com/questions/25459386/mac-os-x-environmenterror-mysql-config-not-found
2017-03-06
共3条回复

bobby

2016-12-26

请问你这是在windows下安装还是linux下安装?

0
3
bobby
回复
一笔勾勒难成书
回复 明天15: pip install mysqlclient
2017-02-26
共3条回复

Python3.6+django+xadmin,打造在线教育平台

【毕设】Python 2.7到3.6 完美适配,Django升级2.0

3677 学习 · 4038 问题

查看课程