2017-07-16 38 views
0

安裝的mysql我試圖安裝在我的虛擬環境中的mysql運行在python3.5.2但它總是會拋出錯誤爲:錯誤而在Fedora25

(venv) [[email protected] mysite]$ pip install mysqlclient 
    Collecting mysqlclient   
    Using cached mysqlclient-1.3.10.tar.gz 
    Complete output from command python setup.py egg_info: 
    /bin/sh: mysql_config: command not found 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "/tmp/pip-build-m92fr1vk/mysqlclient/setup.py", line 17, in <module> 
     metadata, options = get_config() 
     File "/tmp/pip-build-m92fr1vk/mysqlclient/setup_posix.py", line 44, in get_config  libs = mysql_config("libs_r")  
     File "/tmp/pip-build-m92fr1vk/mysqlclient/setup_posix.py", line 26, in mysql_config  
     raise EnvironmentError("%s not found" % (mysql_config.path,))  
    OSError: mysql_config not found 

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-m92fr1vk/mysqlclient/ 

回答

0

鬱需要OS安裝mysql-devel包。

yum install mysql-devel 

os就像那樣。

+0

我沒有試過,它說:'最後元數據到期檢查:1:11:33前在Sun Jul 16 18:33:02 2017.' '沒有包libmysqlclient-dev可用' –

+0

它被稱爲'mysql-devel '在Fedora中,對不起。 'libmysqlclient-dev'用於Debian/Ubuntu。 – phd

+0

但仍然無法正常工作。它說沒有可用的包。我嘗試使用'dnf search mysql-deve1'進行搜索,但沒有運氣 –