您好,登錄后才能下訂單哦!
本文主要給大家簡(jiǎn)單講講mac下安裝mysqlclient報(bào)錯(cuò)怎么處理,相關(guān)專業(yè)術(shù)語(yǔ)大家可以上網(wǎng)查查或者找一些相關(guān)書籍補(bǔ)充一下,這里就不涉獵了,我們就直奔主題吧,希望mac下安裝mysqlclient報(bào)錯(cuò)怎么處理這篇文章可以給大家?guī)硪恍?shí)際幫助。
命令如下:
$ pip3 install mysqlclient
pip3是因?yàn)橛袃蓚€(gè)python版本,給python3.6對(duì)應(yīng)的pip起了個(gè)別名。不然提示找不到。
報(bào)錯(cuò)如下:
Collecting mysqlclient Using cached mysqlclient-1.3.12.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 "/private/var/folders/ww/hnzjh3z517d72m15ybyhwkbw0000gn/T/pip-build-mvq09hkr/mysqlclient/setup.py", line 17, in <module> metadata, options = get_config() File "/private/var/folders/ww/hnzjh3z517d72m15ybyhwkbw0000gn/T/pip-build-mvq09hkr/mysqlclient/setup_posix.py", line 44, in get_config libs = mysql_config("libs_r") File "/private/var/folders/ww/hnzjh3z517d72m15ybyhwkbw0000gn/T/pip-build-mvq09hkr/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 /private/var/folders/ww/hnzjh3z517d72m15ybyhwkbw0000gn/T/pip-build-mvq09hkr/mysqlclient/
解決方法:
1、在~/.bash_profile中加入mysql.的路徑
$ cat ~/.bash_profile # 添加/usr/local/mysql/bin set PATH /Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/mysql/bin export PATH
2、安裝mysql-connector-c
brew install mysql-connector-c
如果電腦沒有安裝brew,按照以下方式安裝brew,再安裝mysql-connector-c:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
3、再次安裝
$ pip3 install mysqlclient
mac下安裝mysqlclient報(bào)錯(cuò)怎么處理就先給大家講到這里,對(duì)于其它相關(guān)問題大家想要了解的可以持續(xù)關(guān)注我們的行業(yè)資訊。我們的板塊內(nèi)容每天都會(huì)捕捉一些行業(yè)新聞及專業(yè)知識(shí)分享給大家的。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。