当前位置:首页 > 云计算 > 正文内容

python中dev安装失败怎么办

2022-05-04 03:17:49云计算2

安装tensorflow之前需要先安装python—dev, 这个不能用pip install来安装,只能用sudo apt-get install来安装。安装后会发现还要

先装另外两个东西,但是装这两个东西也还要继续装其他东西,相当麻烦且并没有成功

~$sudoapt-getinstallpython-dev
Readingpackagelists...Done
Buildingdependencytree
Readingstateinformation...Done
Somepackagescouldnotbeinstalled.Thismaymeanthatyouhave
requestedanimpossiblesituationorifyouareusingtheunstable
distributionthatsomerequiredpackageshavenotyetbeencreated
orbeenmovedoutofIncoming.
Thefollowinginformationmayhelptoresolvethesituation:

Thefollowingpackageshaveunmetdependencies:
python-dev:Depends:libpython-dev(=2.7.11-1)butitisnotgoingtobeinstalled
Depends:python2.7-dev(>=2.7.11-1~)butitisnotgoingtobeinstalled
E:Unabletocorrectproblems,youhaveheldbrokenpackages.

用aptitude 工具可以搞定

先:sudoapt-getinstall aptitude

然后:

sudo aptitude install python-dev,之后会出现:

sudoaptitudeinstallpython-dev
ThefollowingNEWpackageswillbeinstalled:
libexpat1-dev{ab}libpython-dev{a}libpython2.7-dev{ab}python-dev
python2.7-dev{ab}
packagesupgraded,5newlyinstalled,0toremoveand1notupgraded.
Needtoget28.1MBofarchives.Afterunpacking42.1MBwillbeused.
Thefollowingpackageshaveunmetdependencies:
python2.7-dev:Depends:python2.7(=2.7.11-2)but2.7.12-1ubuntu0~16.04.1isinstalled.
Depends:libpython2.7(=2.7.11-2)but2.7.12-1ubuntu0~16.04.1isinstalled.
libexpat1-dev:Depends:libexpat1(=2.1.0-7)but2.1.0-7ubuntu0.16.04.2isinstalled.
libpython2.7-dev:Depends:libpython2.7-stdlib(=2.7.11-2)but2.7.12-1ubuntu0~16.04.1isinstalled.
Depends:libpython2.7(=2.7.11-2)but2.7.12-1ubuntu0~16.04.1isinstalled.
open:24;closed:106;defer:16;conflict:21.Thefollowingactionswillresolve
thesedependencies:

Keepthefollowingpackagesattheircurrentversion:
1)libexpat1-dev[NotInstalled]
2)libpython-dev[NotInstalled]
3)libpython2.7-dev[NotInstalled]
4)python-dev[NotInstalled]
5)python2.7-dev[NotInstalled]



Acceptthissolution?[Y/n/q/?]n这里一定要n,因为给的solution是保持现在的状态,即不安装
Thefollowingactionswillresolvethesedependencies:

Downgradethefollowingpackages:
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)]



Acceptthissolution?[Y/n/q/?]y接受新状态就可以安装了

本网站文章仅供交流学习 ,不作为商用, 版权归属原作者,部分文章推送时未能及时与原作者取得联系,若来源标注错误或侵犯到您的权益烦请告知,我们将立即删除.

本文链接:https://www.xibujisuan.cn/12032.html

标签: Python