美文网首页
unbuntu 安装 mysql-python 错误信息 Env

unbuntu 安装 mysql-python 错误信息 Env

作者: Matt_Z_ | 来源:发表于2017-11-27 10:29 被阅读0次

    错误信息: EnvironmentError: mysql_config not found

    Collecting MySQL-python
      Using cached MySQL-python-1.2.5.zip
        Complete output from command python setup.py egg_info:
        sh: 1: mysql_config: not found
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/tmp/pip-build-RlnZHJ/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-RlnZHJ/MySQL-python/
    
    screenshot.png

    解决办法:

    sudo apt-get install libmysqlclient-dev
    

    然后再次执行安装操作

    pip install mysql-python
    

    安装成功

    screenshot.png

    信息来源:https://stackoverflow.com/questions/5178292/pip-install-mysql-python-fails-with-environmenterror-mysql-config-not-found

    相关文章

      网友评论

          本文标题:unbuntu 安装 mysql-python 错误信息 Env

          本文链接:https://www.haomeiwen.com/subject/knsrbxtx.html