• ubuntu 下 python模块 mysql-python安装(转)


    原文:http://www.cnblogs.com/51kata/p/5406468.html

    直接运行如下命令

    sudo pip install MySQL-python

    报如下错误

    xxx@ubuntu:~$ sudo pip install MySQL-python
    Downloading/unpacking MySQL-python
      Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
      Running setup.py (path:/tmp/pip_build_root/MySQL-python/setup.py) egg_info for package MySQL-python
        sh: 1: mysql_config: not found
        Traceback (most recent call last):
          File "<string>", line 17, in <module>
          File "/tmp/pip_build_root/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
        Complete output from command python setup.py egg_info:
        sh: 1: mysql_config: not found

    解决方案是:

    安装python-dev
    sudo apt-get install python-dev

    然后再安装

    sudo apt-get install libmysqlclient-dev

    最后安装

    sudo pip install MySQL-python

    这样就成功了。

  • 相关阅读:
    css font-family(字体样式)
    360浏览器兼容模式,页面不能正常渲染
    SVN 如何更换IP地址
    Update 出现在的问题
    安装node-sass
    vue 里面输出带标签的html
    css 内容超出宽度自动换行
    js 判断各种数据类型
    Java_面向对象三大特征
    Java_基础(二)
  • 原文地址:https://www.cnblogs.com/justbreaking/p/7324563.html
Copyright © 2020-2023  润新知