我正在尝试在我的NAS QNAP上安装MySQL-python,但我收到此错误“找不到mysql_config”,感谢您的支持,低于输出:
[/share/MD0_DATA/.qpkg/Python/src/bin] # ./pip install MySQL-python
Collecting MySQL-python
Using cached MySQL-python-1.2.5.zip
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/share/MD0_DATA/.qpkg/Qnapware/opt/tmp/pip-build-UYwTq4/MySQL-python/setup.py", line 17, 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 25, 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 in /share/MD0_DATA/.qpkg/Qnapware/opt/tmp/pip-build-UYwTq4/MySQL-python/
即使我尝试使用类似的套餐..
[/share/MD0_DATA/.qpkg/Python/src/bin] # ./pip install mysqlclient
Collecting mysqlclient
Using cached mysqlclient-1.3.12.tar.gz
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/share/MD0_DATA/.qpkg/Qnapware/opt/tmp/pip-build-lOv7DC/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Pip命令失败并出现上述错误跟踪。
解决: 我发现在通过QPKG安装Python 2.7之后,通过QPKG使用./pip并使用mysql-connector ==旧版本,这个与Pyhton库存不同的路径是安装程序没有问题。