這篇文章將為大家詳細講解有關(guān)如何解決python中dev安裝失敗的問題,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
沽源ssl適用于網(wǎng)站、小程序/APP、API接口等需要進行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!
安裝tensorflow之前需要先安裝python—dev, 這個不能用pip install來安裝,只能用sudo apt-get install來安裝。安裝后會發(fā)現(xiàn)還要
先裝另外兩個東西,但是裝這兩個東西也還要繼續(xù)裝其他東西,相當(dāng)麻煩且并沒有成功
~$ sudo apt-get install python-dev Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: python-dev : Depends: libpython-dev (= 2.7.11-1) but it is not going to be installed Depends: python2.7-dev (>= 2.7.11-1~) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
用aptitude 工具可以搞定
先:sudo apt-get install aptitude
然后:
sudo aptitude install python-dev,之后會出現(xiàn):
sudo aptitude install python-dev The following NEW packages will be installed: libexpat1-dev{ab} libpython-dev{a} libpython2.7-dev{ab} python-dev python2.7-dev{ab} packages upgraded, 5 newly installed, 0 to remove and 1 not upgraded. Need to get 28.1 MB of archives. After unpacking 42.1 MB will be used. The following packages have unmet dependencies: python2.7-dev : Depends: python2.7 (= 2.7.11-2) but 2.7.12-1ubuntu0~16.04.1 is installed. Depends: libpython2.7 (= 2.7.11-2) but 2.7.12-1ubuntu0~16.04.1 is installed. libexpat1-dev : Depends: libexpat1 (= 2.1.0-7) but 2.1.0-7ubuntu0.16.04.2 is installed. libpython2.7-dev : Depends: libpython2.7-stdlib (= 2.7.11-2) but 2.7.12-1ubuntu0~16.04.1 is installed. Depends: libpython2.7 (= 2.7.11-2) but 2.7.12-1ubuntu0~16.04.1 is installed. open: 24; closed: 106; defer: 16; conflict: 21 .The following actions will resolve these dependencies: Keep the following packages at their current version: 1) libexpat1-dev [Not Installed] 2) libpython-dev [Not Installed] 3) libpython2.7-dev [Not Installed] 4) python-dev [Not Installed] 5) python2.7-dev [Not Installed] Accept this solution? [Y/n/q/?] n 這里一定要n,因為給的solution是保持現(xiàn)在的狀態(tài),即不安裝 The following actions will resolve these dependencies: Downgrade the following packages: 1) libexpat1 [2.1.0-7ubuntu0.16.04.2 (now) -> 2.1.0-7 (xenial)] 2) libpython2.7 [2.7.12-1ubuntu0~16.04.1 (now) -> 2.7.11-2 (xenial)] 3) libpython2.7-minimal [2.7.12-1ubuntu0~16.04.1 (now) -> 2.7.11-2 (xenial)] 4) libpython2.7-stdlib [2.7.12-1ubuntu0~16.04.1 (now) -> 2.7.11-2 (xenial)] 5) python2.7 [2.7.12-1ubuntu0~16.04.1 (now) -> 2.7.11-2 (xenial)] 6) python2.7-minimal [2.7.12-1ubuntu0~16.04.1 (now) -> 2.7.11-2 (xenial)] Accept this solution? [Y/n/q/?] y 接受新狀態(tài)就可以安裝了
關(guān)于如何解決python中dev安裝失敗的問題就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。