Django. MySQL — различия между версиями

Материал из Я Админ
Перейти к: навигация, поиск
(Новая страница: «=Linux= ==Установка клиента MySQL== ===Ошибка установки клиента MySQL=== pip install mysqlclient Collecting mysqlclient U…»)
 
Строка 1: Строка 1:
 
=Linux=
 
=Linux=
 
==Установка клиента MySQL==
 
==Установка клиента MySQL==
 +
 +
pip install mysqlclient
 +
 
===Ошибка установки клиента MySQL===
 
===Ошибка установки клиента MySQL===
 
  pip install mysqlclient
 
  pip install mysqlclient
Collecting mysqlclient
+
 
 +
Collecting mysqlclient
 
   Using cached mysqlclient-2.1.1.tar.gz (88 kB)
 
   Using cached mysqlclient-2.1.1.tar.gz (88 kB)
 
   Preparing metadata (setup.py) ... error
 
   Preparing metadata (setup.py) ... error
Строка 30: Строка 34:
 
    
 
    
 
   note: This error originates from a subprocess, and is likely not a problem with pip.
 
   note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
+
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.
  
× Encountered error while generating package metadata.
+
Для исправления ошибки:
╰─> See above for output.
+
  
note: This is an issue with the package mentioned above, not pip.
+
sudo apt install libmysqlclient-dev
hint: See above for details.
+
sudo aptitude install python3-dev
  
 +
https://stackoverflow.com/questions/42640924/troubles-installing-mysqlclient-with-pip3
  
 
[[Category:Django]]
 
[[Category:Django]]

Версия 21:52, 22 сентября 2022

Linux

Установка клиента MySQL

pip install mysqlclient

Ошибка установки клиента MySQL

pip install mysqlclient
Collecting mysqlclient
 Using cached mysqlclient-2.1.1.tar.gz (88 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-xgyv4lm5/mysqlclient_030ce29558df4cf6bfd1de16e62dd640/setup.py", line 15, in <module>
         metadata, options = get_config()
       File "/tmp/pip-install-xgyv4lm5/mysqlclient_030ce29558df4cf6bfd1de16e62dd640/setup_posix.py", line 70, in get_config
         libs = mysql_config("libs")
       File "/tmp/pip-install-xgyv4lm5/mysqlclient_030ce29558df4cf6bfd1de16e62dd640/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.

Для исправления ошибки:

sudo apt install libmysqlclient-dev
sudo aptitude install python3-dev

https://stackoverflow.com/questions/42640924/troubles-installing-mysqlclient-with-pip3