如何解決centos7安裝MySQLdb-python報(bào)錯(cuò)

如何解決centos7安裝MySQLdb-python報(bào)錯(cuò),相信很多沒有經(jīng)驗(yàn)的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個(gè)問題。

資源網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián),資源網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為資源上千余家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站建設(shè)要多少錢,請找那個(gè)售后服務(wù)好的資源做網(wǎng)站的公司定做!

運(yùn)行 pip install MySQL-Python 報(bào)錯(cuò): 云服務(wù)器

Command python setup.py egg_info failed with error code 1 in

繼續(xù)試探

yum install mysql-devel
 systemctl restart mariadb

之后再安裝報(bào)錯(cuò):

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-GMXMYA/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('
', '
');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-VMNV_c-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /t
mp/pip-build-GMXMYA/MySQL-python/

繼續(xù)找安裝

yum install MySQL-python 
 systemctl restart mariadb

測試是否安裝成功

python 

進(jìn)入 python之后 執(zhí)行

>>> import MySQLdb
>>> print dir(MySQLdb)
['BINARY', 'Binary', 'Connect', 'Connection', 'DATE', 'DATETIME', 'DBAPISet', 'DataError', 'DatabaseError', 'Date', 'DateFromTicks', 'Error', 'FIELD_TYPE', 'IntegrityError', 'InterfaceError', 'InternalError', 'MySQLError', 'NULL', 'NUMBER', 'NotSupportedError', 'OperationalError', 'ProgrammingError', 'ROWID', 'STRING', 'TIME', 'TIMESTAMP', 'Time', 'TimeFromTicks', 'Timestamp', 
'TimestampFromTicks', 'Warning', '__all__', '__author__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__revision__', '__version__', '_mysql', 'apilevel', '
connect', 'connection', 'constants', 'debug', 'escape', 'escape_dict', 'escape_sequence', 'escape_string', 'get_client_info', 'paramstyle', 'release', 'result', 'server_end', 'server_init', 
'string_literal', 'test_DBAPISet_set_equality', 'test_DBAPISet_set_equality_membership', 'test_DBAPISet_set_inequality', 'test_DBAPISet_set_inequality_membership', 'thread_safe', 'threadsafe
ty', 'times', 'version_info']

因?yàn)橄到y(tǒng)用 yum install MySQLdb-python 來替代 pip install MySQLdb-python Author: 

看完上述內(nèi)容,你們掌握如何解決centos7安裝MySQLdb-python報(bào)錯(cuò)的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!

名稱欄目:如何解決centos7安裝MySQLdb-python報(bào)錯(cuò)
文章鏈接:http://www.muchs.cn/article28/jpcocp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站制作、服務(wù)器托管、網(wǎng)站內(nèi)鏈軟件開發(fā)、微信小程序、商城網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

搜索引擎優(yōu)化