[Seek Help] python安装mysqlclient库安装报错
Tofloor
poster avatar
初涉deepin
deepin
2023-03-02 05:50
Author

按照百度操作了好几天,就是安装不了,pytyhon换了各种版本也是安装不了

image.png

Collecting mysqlclient
Using cached mysqlclient-2.1.1.tar.gz (88 kB)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 "", line 36, in
File "", line 34, in
File "/tmp/pip-install-x1njusyj/mysqlclient_e104dc232fa04eca92dd25fdb239af20/setup.py", line 15, in libs = mysql_config("libs")
File "/tmp/pip-install-x1njusyj/mysqlclient_e104dc232fa04eca92dd25fdb239af20/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. See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

[notice] A new release of pip available: 22.3.1 -> 23.0.1
[notice] To update, run: pip install --upgrade pip

Reply Favorite View the author
All Replies
avatar
初涉deepin
deepin
2023-03-02 05:51
#1

在windows上很方便的就安装上了

Reply View the author
avatar
xuqi
deepin testing team
2023-03-02 06:17
#2
  • sudo apt-get install default-mysql-server default-mysql-client
Reply View the author
avatar
xuqi
deepin testing team
2023-03-02 06:18
#3

* MySQL数据库基础快速入门

  • 可以参考https://blog.51cto.com/jkdev/4633933
Reply View the author
avatar
初涉deepin
deepin
2023-03-02 15:09
#4

这个与mysql毫无关系,这只是一个python第三方库

Reply View the author
avatar
DebuggerX
deepin
2023-03-02 15:39
#5
  1. 换pymysql,和mysqlclient的区别可以自己百度
  2. 不要在windows分区上写代码搞开发,容易出问题
Reply View the author