ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full comm

ERROR: Command errored out with exit status 1:
     command: /media/yang/productdisk/zufang/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fx53gvkb/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fx53gvkb/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-7c4jyply
         cwd: /tmp/pip-install-fx53gvkb/mysqlclient/
    Complete output (12 lines):
    /bin/sh: 1: mysql_config: not found
    /bin/sh: 1: mariadb_config: not found
    /bin/sh: 1: mysql_config: not found
    Traceback (most recent call last):
      File "", line 1, in 
      File "/tmp/pip-install-fx53gvkb/mysqlclient/setup.py", line 16, in 
        metadata, options = get_config()
      File "/tmp/pip-install-fx53gvkb/mysqlclient/setup_posix.py", line 61, in get_config
        libs = mysql_config("libs")
      File "/tmp/pip-install-fx53gvkb/mysqlclient/setup_posix.py", line 29, in mysql_config
        raise EnvironmentError("%s not found" % (_mysql_config_path,))
    OSError: mysql_config not found
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

  1. 分析
    安装Mysqlclient报的错
  2. 第一种情况:pip install 安装报错
    如果是python 2.x版本的,在命令行输入执行:pip install MySQLdb即可安装成功
    如果是python 3.x版本的,直接用pip install MySQLdb无法安装,接下来解答安装过程。(2019年以后,大家遇到的情况应该都集中在3.x版本情况)
    【解决方法】网页下载安装包:https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full comm_第1张图片
    到这里可能又有人蒙蔽了
    打开Python或者ipython
    import pip._internal
    print(pip._internal.pep425tags.get_supported())
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full comm_第2张图片
  3. 下载
    经过对比,我应该下载这个版本
    在这里插入图片描述
  4. 修改名称
    不修改名称的话会有提示不能安装
    在这里插入图片描述
  5. 成功安装
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full comm_第3张图片

你可能感兴趣的:(deepin折腾篇,Python)