安装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
然后:
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.py.cn
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容