pip 導入包時出現以下錯誤python
1 Complete output from command python setup.py egg_info: 2 /bin/sh: 1: mysql_config: not found 3 Traceback (most recent call last): 4 File "<string>", line 1, in <module> 5 File "/tmp/pip-install-6p9kqc0e/mysqlclient/setup.py", line 17, in <module> 6 metadata, options = get_config() 7 File "/tmp/pip-install-6p9kqc0e/mysqlclient/setup_posix.py", line 44, in get_config 8 libs = mysql_config("libs_r") 9 File "/tmp/pip-install-6p9kqc0e/mysqlclient/setup_posix.py", line 26, in mysql_config 10 raise EnvironmentError("%s not found" % (mysql_config.path,)) 11 OSError: mysql_config not found 12 13 ---------------------------------------- 14 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-6p9kqc0e/mysqlclient/
出現上面錯誤主要仍是由於未安裝python依賴,及mysqlclient:mysql
問題解決:sql
1 sudo apt-get install python3-dev libmysqlclient-dev 2 pip install mysqlclient