Как исправить ошибку, возникающую при установке mysqlclient для django в ubantu?
Я пытаюсь установить mysqlclient и получаю следующую ошибку. Я использую Ubuntu 20.04 LTS. Я также выполнил команды update и upgrade.
Мой пароль mysql - toor
mysql -u root -p toor
(cc_env) amol@amol-Ideapad-320:~/My Code/Python/Project$ pip install mysqlclient
Collecting mysqlclient
Using cached 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: 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 "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-2erfc_zu/mysqlclient_02a7d23804a54d6dafa6098aa7d9f18f/setup.py", line 15, in <module>
metadata, options = get_config()
File "/tmp/pip-install-2erfc_zu/mysqlclient_02a7d23804a54d6dafa6098aa7d9f18f/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/tmp/pip-install-2erfc_zu/mysqlclient_02a7d23804a54d6dafa6098aa7d9f18f/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.
список труб
(cc_env) amol@amol-Ideapad-320:~/My Code/Python/Project$ pip list
Package Version
------------------- -------
asgiref 3.5.0
backports.zoneinfo 0.2.1
Django 4.0.3
django-cors-headers 3.11.0
djangorestframework 3.13.1
ez-setup 0.9
pip 22.0.4
pytz 2022.1
setuptools 61.3.1
sqlparse 0.4.2
wheel 0.37.1
python version
(cc_env) amol@amol-Ideapad-320:~/My Code/Python/Project$ python -V
Python 3.8.10
Я создал виртуальную среду.