gpt4 book ai didi

python - pip install mysql-python 失败,EnvironmentError : mysql_config not found

转载 作者:IT老高 更新时间:2023-10-28 11:59:19 26 4
gpt4 key购买 nike

这是我得到的错误

(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python
Downloading/unpacking mysql-python
Downloading MySQL-python-1.2.3.tar.gz (70Kb): 70Kb downloaded
Running setup.py egg_info for package mysql-python
sh: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Complete output from command python setup.py egg_info:
sh: mysql_config: not found

Traceback (most recent call last):

File "<string>", line 14, in <module>

File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in <module>

metadata, options = get_config()

File "setup_posix.py", line 43, in get_config

libs = mysql_config("libs_r")

File "setup_posix.py", line 24, in mysql_config

raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: mysql_config not found

----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/zjm1126/.pip/pip.log
(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python
Downloading/unpacking mysql-python
Running setup.py egg_info for package mysql-python
sh: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Complete output from command python setup.py egg_info:
sh: mysql_config: not found

Traceback (most recent call last):

File "<string>", line 14, in <module>

File "/home/zjm1126/zjm_test/mysite/build/mysql-python/setup.py", line 15, in <module>

metadata, options = get_config()

File "setup_posix.py", line 43, in get_config

libs = mysql_config("libs_r")

File "setup_posix.py", line 24, in mysql_config

raise EnvironmentError("%s not found" % (mysql_config.path,))

EnvironmentError: mysql_config not found

----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/zjm1126/.pip/pip.log

我能做些什么来解决这个问题?

最佳答案

您的系统上似乎缺少 mysql_config 或安装程序找不到它。确保 mysql_config 确实已安装。

例如在 Debian/Ubuntu 上,您必须安装该软件包:

sudo apt-get install libmysqlclient-dev

可能mysql_config不在你的路径下,你自己编译的时候会这样mysql 套件。

更新:对于最新版本的 debian/ubuntu(截至 2018 年)是

sudo apt install default-libmysqlclient-dev

关于python - pip install mysql-python 失败,EnvironmentError : mysql_config not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5178292/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com