安装tensorflow之前需要先安装python—dev, 这个不能用pip install来安装,只能用sudo apt-get install来安装。安装后会发现还要先装另外两个东西,但是装这两个东西也还要继续装其他东西,相当麻烦且并没有成功

~$ 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,之后会出现:

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}
0 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是保持现在的状态,即不安装
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 接受新状态就可以安装了

python-dev无法安装的更多相关文章

  1. Python 使用 virtualenvwrapper 安装虚拟环境

    装载于https://www.jianshu.com/p/9f47a9801329 Python 使用 virtualenvwrapper 安装虚拟环境 Tim_Lee 关注 2017.05.04 2 ...

  2. Ubuntu 16.04 python和OpenCV安装

    Ubuntu 16.04 python和OpenCV安装:最进在做深度学习和计算机视觉的有关内容,因此要在python中用到opencv.我的电脑装的是Ubuntu 16.04,python 2.7和 ...

  3. ubuntu python及python IDLE 的安装

    ubuntu下Python的安装和使用 文章参考出处:https://www.cnblogs.com/luckyalan/p/6703590.html ubuntu14.04 安装Python2.7: ...

  4. Python 2/3 安装与运行环境设置

    Python 2/3 安装与运行环境设置: 1.Python 软件源:https://www.python.org/    下载Win版本 https://www.python.org/downloa ...

  5. Python介绍、安装、使用

    Python介绍.安装.使用 搬运工:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Python语言介绍 说到Python语言,就不得不说一下它的创始人Guido van Rossu ...

  6. python开发_mysqldb安装

    在python的API上面,看到了MySQLdb,即python可以操作mysql数据库 接下来,我就把我这两天的工作给大伙絮叨絮叨: 准备条件: 1.MySQL-python-1.2.4b4.win ...

  7. Windows上python开发--2安装django框架

    Windows上python开发--2安装django框架 分类: 服务器后台开发2014-05-17 21:22 2310人阅读 评论(2) 收藏 举报 python django 上一篇文章中讲了 ...

  8. 【Python】如何安装easy_install?

    [Python]如何安装easy_install? http://jingyan.baidu.com/article/b907e627e78fe146e7891c25.html easy_instal ...

  9. Python入门-----Windows安装

    摘要:Python,windows安装 1.进入python的官方网站下载:https://www.python.org 点击Download,选择windows版本:

  10. 关于已经安装python为何还要安装python-dev

    linux发行版通常会把类库的头文件和相关的pkg-config分拆成一个单独的xxx-dev(el)包. 以python为例, 以下情况你是需要python-dev的 你需要自己安装一个源外的pyt ...

随机推荐

  1. 变形--原点 transform-origin

    任何一个元素都有一个中心点,默认情况之下,其中心点是居于元素X轴和Y轴的50%处.如下图所示: 在没有重置transform-origin改变元素原点位置的情况下,CSS变形进行的旋转.位移.缩放,扭 ...

  2. Codeforces Beta Round #93 (Div. 1 Only) D. Fibonacci Sums

    先考虑一个斐波那契数能分成其他斐波那契数的方案,假如f[i]表示第i个斐波那契数,那么只要对他进行拆分,f[i-1]这个数字必定会存在.知道这一点就可以进行递推了.先将数字分成最少项的斐波那契数之和, ...

  3. zw版【转发·台湾nvp系列Delphi例程】HALCON SetMshape

    zw版[转发·台湾nvp系列Delphi例程]HALCON SetMshape procedure TForm1.FormShow(Sender: TObject);var img : HImageX ...

  4. 向已写好的多行插入sql语句中添加字段和值

    #region 添加支款方式--向已写好的多行插入sql语句中添加字段和值 public int A_ZhifuFS(int diqu) { ; string strData = @"SEL ...

  5. 【NOIP模拟赛】正方形大阵

    正方形大阵 [问题描述]   [输入格式]   第一行一个正整数n代表询问次数. 接下来n行每行一个不超过八位的小数k代表一组询问. [输出格式]   输出共n行,代表每次询问的答案:如果有无数个交点 ...

  6. OpenStack 计算节点删除

    前提 计算节点中一个僵尸计算节点存在,而里面的CPU数目在总物理CPU中,导致认为当前能创建实例.而实际没有这么多资源. 其中node-11为僵尸节点. 原因 删除计算节点不能直接格式化该服务器,否则 ...

  7. EF数据库连接时候出错

    users: EntityType: EntitySet 'users' is based on type 'UserModel' that has no keys defined. TreeLaye ...

  8. HorizontalScrollView的配置

    package com.exmple.jinritoutiao; import java.util.ArrayList;import java.util.Calendar;import java.ut ...

  9. javascript 深拷贝

    javascript存在两种拷贝:浅拷贝.深拷贝. 它们最大的区别在于引用类型的拷贝上:浅拷贝复制的是引用(指针),深拷贝复制的是里面的数据. 由于以上原因,在下例中 浅拷贝修改的值影响了声明的对象a ...

  10. ss 公共代理的必要设置(转)

    转: https://gist.github.com/fqrouter/95c037f9a3ba196fd4dd 本文只关注于确保ss服务还“活着”,如果你希望让其跑得更快,请参考 https://g ...