1

我正在尝试在我的 NAS QNAP 上安装 MySQL-python,但在输出下方出现此错误“mysql_config not found”,感谢您的支持:

[/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 后,到此路径的路径与股票 Pyhton 不同,在此 QPKG 中使用 ./pip 并使用 mysql-connector==older 版本,安装程序没有问题。

4

0 回答 0