(venvll) ➜ house-fill-backend git:(master) pip install mysqlclient
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting mysqlclient
Using cached https://mirrors.aliyun.com/pypi/packages/de/79/d02be3cb942afda6c99ca207858847572e38146eb73a7c4bfe3bdf154626/mysqlclient-2.1.0.tar.gz (87 kB)
Preparing metadata (setup.py)... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─>[16 lines of output]
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 2, in<module>
File "<pip-setuptools-caller>", line 34, in<module>
File "/private/var/folders/jp/5gv4t7ld6w357fdnhj7cztlr0000gn/T/pip-install-1fwix3k6/mysqlclient_0125d3d94747427e917b085d78d06e9d/setup.py", line 15, in<module>
metadata, options = get_config()
File "/private/var/folders/jp/5gv4t7ld6w357fdnhj7cztlr0000gn/T/pip-install-1fwix3k6/mysqlclient_0125d3d94747427e917b085d78d06e9d/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/private/var/folders/jp/5gv4t7ld6w357fdnhj7cztlr0000gn/T/pip-install-1fwix3k6/mysqlclient_0125d3d94747427e917b085d78d06e9d/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
错误案例2
(venvll) ➜ house-fill-backend git:(master) pip install mysqlclient
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Collecting mysqlclient
Using cached https://mirrors.aliyun.com/pypi/packages/de/79/d02be3cb942afda6c99ca207858847572e38146eb73a7c4bfe3bdf154626/mysqlclient-2.1.0.tar.gz (87 kB)
ERROR: Command errored out with exit status 1:
command: /Users/lidong/Desktop/zhouyu/project/house-fill-backend/venvll/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/jp/5gv4t7ld6w357fdnhj7cztlr0000gn/T/pip-install-_hrx0uvh/mysqlclient_12f10e02b7054febafb43cd00aa41760/setup.py'"'"'; __file__='"'"'/private/var/folders/jp/5gv4t7ld6w357fdnhj7cztlr0000gn/T/pip-install-_hrx0uvh/mysqlclient_12f10e02b7054febafb43cd00aa41760/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/jp/5gv4t7ld6w357fdnhj7cztlr0000gn/T/pip-pip-egg-info-ja99ae85
cwd: /private/var/folders/jp/5gv4t7ld6w357fdnhj7cztlr0000gn/T/pip-install-_hrx0uvh/mysqlclient_12f10e02b7054febafb43cd00aa41760/
Complete output (15 lines):
/bin/sh: mysql_config: command not found
/bin/sh: mariadb_config: command not found
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in<module>
File "/private/var/folders/jp/5gv4t7ld6w357fdnhj7cztlr0000gn/T/pip-install-_hrx0uvh/mysqlclient_12f10e02b7054febafb43cd00aa41760/setup.py", line 15, in<module>
metadata, options = get_config()
File "/private/var/folders/jp/5gv4t7ld6w357fdnhj7cztlr0000gn/T/pip-install-_hrx0uvh/mysqlclient_12f10e02b7054febafb43cd00aa41760/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/private/var/folders/jp/5gv4t7ld6w357fdnhj7cztlr0000gn/T/pip-install-_hrx0uvh/mysqlclient_12f10e02b7054febafb43cd00aa41760/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
----------------------------------------
WARNING: Discarding https://mirrors.aliyun.com/pypi/packages/de/79/d02be3cb942afda6c99ca207858847572e38146eb73a7c4bfe3bdf154626/mysqlclient-2.1.0.tar.gz#sha256=973235686f1b720536d417bf0a0d39b4ab3d5086b2b6ad5e6752393428c02b12 (from https://mirrors.aliyun.com/pypi/simple/mysqlclient/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached https://mirrors.aliyun.com/pypi/packages/3c/df/59cd2fa5e48d0804d213bdcb1acb4d08c403b61c7ff7ed4dd4a6a2deb3f7/mysqlclient-2.0.3.tar.gz (88 kB)