【问题标题】:Error to install MYSQLCLIENT python Linux安装 MYSQLCLIENT python Linux 时出错
【发布时间】:2020-12-14 20:58:15
【问题描述】:

我正在尝试在 linux 上安装 mysqlclient,并在下面不断收到此错误。

我已经尝试过更新:

sudo apt-get install build-essential sudo apt-get install libssl-dev

并且错误仍然存​​在:

^C(venv) pip install mysqlclient
Collecting mysqlclient
  Using cached mysqlclient-2.0.2.tar.gz (88 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/felipecid/PycharmProjects/djangoAgenda/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ct6grj28/mysqlclient_e1f80e76b30f4edaaa24bdcfc6a54e18/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ct6grj28/mysqlclient_e1f80e76b30f4edaaa24bdcfc6a54e18/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-1wsevah8
         cwd: /tmp/pip-install-ct6grj28/mysqlclient_e1f80e76b30f4edaaa24bdcfc6a54e18/
    Complete output (12 lines):
    /bin/sh: mysql_config: comando não encontrado
    /bin/sh: mariadb_config: comando não encontrado
    /bin/sh: mysql_config: comando não encontrado
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-ct6grj28/mysqlclient_e1f80e76b30f4edaaa24bdcfc6a54e18/setup.py", line 15, in <module>
        metadata, options = get_config()
      File "/tmp/pip-install-ct6grj28/mysqlclient_e1f80e76b30f4edaaa24bdcfc6a54e18/setup_posix.py", line 65, in get_config
        libs = mysql_config("libs")
      File "/tmp/pip-install-ct6grj28/mysqlclient_e1f80e76b30f4edaaa24bdcfc6a54e18/setup_posix.py", line 31, in mysql_config
        raise OSError("{} not found".format(_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.

【问题讨论】:

  • 请不要将文本输出作为图像或图像链接发布 - reasoning。将其作为格式化文本复制到问题中。
  • 对不起现在更好
  • /bin/sh: mysql_config: comando não encontrado MySQL 安装了吗?
  • 试试pip install mysqlclient==2.0.1

标签: python mysql linux


【解决方案1】:

问题是因为我使用的是 DISTR Linux Mint 版本,只需使用常规 Unbuntu 版本即可!

【讨论】:

    猜你喜欢
    • 2018-10-23
    • 2021-12-08
    • 2023-03-20
    • 2019-06-18
    • 2023-03-30
    • 2018-09-01
    相关资源
    最近更新 更多