ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-e7q1vcuk/mysqlclient/解决办法!

Collecting mysqlclient==1.4.2
  Downloading http://pypi.doubanio.com/packages/73/79/67ddf24ac31b05d741f0ac87fa612c7a11bab1b39b8270ed7344d149f8af/mysqlclient-1.4.2.tar.gz (85kB)
     |████████████████████████████████| 92kB 1.3MB/s 
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: /bin/sh: 1: mysql_config: not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-e7q1vcuk/mysqlclient/setup.py", line 16, in <module>
        metadata, options = get_config()
      File "/tmp/pip-install-e7q1vcuk/mysqlclient/setup_posix.py", line 51, in get_config
        libs = mysql_config("libs")
      File "/tmp/pip-install-e7q1vcuk/mysqlclient/setup_posix.py", line 29, in mysql_config
        raise EnvironmentError("%s not found" % (_mysql_config_path,))
    OSError: mysql_config not found
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-e7q1vcuk/mysqlclient/

解决办法:

sudo apt-get install mysql-server mysql-client
然后mysql -V查看mysql是否安装成功
sudo  apt-get install libmysqlclient-dev python3-dev
然后
pip install mysqlclient就不会报错找不到'mysql_config'

 

posted @ 2019-07-22 22:36  青春叛逆者  阅读(432)  评论(0编辑  收藏  举报