如何解决python中dev安装失败的问题
这篇文章将为大家详细讲解有关如何解决python中dev安装失败的问题,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
安装tensorflow之前需要先安装python—dev, 这个不能用pip install来安装,只能用sudo apt-get install来安装。安装后会发现还要
先装另外两个东西,但是装这两个东西也还要继续装其他东西,相当麻烦且并没有成功
~$sudoapt-getinstallpython-devReadingpackagelists...DoneBuildingdependencytreeReadingstateinformation...DoneSomepackagescouldnotbeinstalled.ThismaymeanthatyouhaverequestedanimpossiblesituationorifyouareusingtheunstabledistributionthatsomerequiredpackageshavenotyetbeencreatedorbeenmovedoutofIncoming.Thefollowinginformationmayhelptoresolvethesituation:Thefollowingpackageshaveunmetdependencies:python-dev:Depends:libpython-dev(=2.7.11-1)butitisnotgoingtobeinstalledDepends:python2.7-dev(>=2.7.11-1~)butitisnotgoingtobeinstalledE:Unabletocorrectproblems,youhaveheldbrokenpackages.
用aptitude 工具可以搞定
先:sudoapt-getinstall aptitude
然后:
sudo aptitude install python-dev,之后会出现:
sudoaptitudeinstallpython-devThefollowingNEWpackageswillbeinstalled:libexpat1-dev{ab}libpython-dev{a}libpython2.7-dev{ab}python-devpython2.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.Thefollowingactionswillresolvethesedependencies: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接受新状态就可以安装了
关于如何解决python中dev安装失败的问题就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。