這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)?lái)有關(guān)openstack nova編譯或打包rpm出現(xiàn)cannot import name integer_types報(bào)錯(cuò)的解決方法,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
創(chuàng)新互聯(lián)于2013年成立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都網(wǎng)站建設(shè)、成都做網(wǎng)站網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元肇東做網(wǎng)站,已為上家服務(wù),為肇東各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:028-86922220
通過(guò)rpmbuild打包nova時(shí),出現(xiàn)了如下報(bào)錯(cuò):
File "/usr/lib/python2.7/site-packages/keystoneauth2/session.py", line 26, in <module> import requests File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 63, in <module> from . import utils File "/usr/lib/python2.7/site-packages/requests/utils.py", line 26, in <module> from .compat import ( ImportError: cannot import name integer_types
大致看了以下報(bào)錯(cuò)信息,應(yīng)該是python的requests模塊安裝有問(wèn)題,查看之前的依賴安裝日志,出現(xiàn)過(guò)如下內(nèi)容:
Failed: python2-requests.noarch 0:2.11.1-1.el7 python2-urllib3.noarch 0:1.16-1.el7
這兩個(gè)模塊安裝失敗,于是單獨(dú)安裝這兩個(gè)模塊,但是均報(bào)錯(cuò)
Downloading packages: (1/2): python2-urllib3-1.16-1.el7.noarch.rpm | 126 kB 00:00:00 (2/2): python2-requests-2.11.1-1.el7.noarch.rpm | 105 kB 00:00:00 ------------------------------------------------------------------------------------------------------------------------------------------------------- Total 190 kB/s | 231 kB 00:00:01 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : python2-urllib3-1.16-1.el7.noarch 1/2 Error unpacking rpm package python2-urllib3-1.16-1.el7.noarch error: unpacking of archive failed on file /usr/lib/python2.7/site-packages/urllib3/packages/ssl_match_hostname: cpio: rename Installing : python2-requests-2.11.1-1.el7.noarch 2/2 Error unpacking rpm package python2-requests-2.11.1-1.el7.noarch error: python2-urllib3-1.16-1.el7.noarch: install failed error: unpacking of archive failed on file /usr/lib/python2.7/site-packages/requests/packages/chardet: cpio: rename Verifying : python2-urllib3-1.16-1.el7.noarch 1/2 Verifying : python2-requests-2.11.1-1.el7.noarch 2/2 Failed: python2-requests.noarch 0:2.11.1-1.el7 python2-urllib3.noarch 0:1.16-1.el7
應(yīng)該是這兩個(gè)模塊已存在的版本有問(wèn)題,于是將site-packages中的這兩個(gè)模塊的內(nèi)容刪除
[root@localhost site-packages]# rm -rf url urlgrabber/ urllib3/ urllib3-1.21.dist-info/ urlgrabber-3.10-py2.7.egg-info urllib3-1.16-py2.7.egg-info/ [root@localhost site-packages]# rm -rf urllib3* [root@localhost site-packages]# rm -rf requests requests/ requestsexceptions/ requests_mock/ requests-2.11.1-py2.7.egg-info/ requestsexceptions-1.1.3-py2.7.egg-info/ requests_mock-1.3.0.dist-info/ requests-2.13.0.dist-info/ requestsexceptions-1.2.0.dist-info/ [root@localhost site-packages]# rm -rf requests [root@localhost site-packages]# rm -rf requests-*
再安裝模塊即可成功
Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : python2-urllib3-1.16-1.el7.noarch 1/2 Installing : python2-requests-2.11.1-1.el7.noarch 2/2 Verifying : python2-urllib3-1.16-1.el7.noarch 1/2 Verifying : python2-requests-2.11.1-1.el7.noarch 2/2 Installed: python2-requests.noarch 0:2.11.1-1.el7 Dependency Installed: python2-urllib3.noarch 0:1.16-1.el7 Complete!
再通過(guò)rpmbuild打包,就沒(méi)有任何問(wèn)題了。
上述就是小編為大家分享的openstack nova編譯或打包rpm出現(xiàn)cannot import name integer_types報(bào)錯(cuò)的解決方法了,如果剛好有類(lèi)似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
文章名稱:openstacknova編譯或打包rpm出現(xiàn)cannotimportnameinteger_types報(bào)錯(cuò)的解決方法
標(biāo)題來(lái)源:http://jinyejixie.com/article8/jopiip.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開(kāi)發(fā)、移動(dòng)網(wǎng)站建設(shè)、動(dòng)態(tài)網(wǎng)站、App設(shè)計(jì)、域名注冊(cè)、虛擬主機(jī)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)