python-dev安装

安装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     接受新状态就可以安装了
时间: 2024-10-15 21:24:15

python-dev安装的相关文章

python 基础安装使用

首先我们来学习一下怎么安装python和更新python,再来学习一些简单的解释器.变量.编码内容.循环等代码 第一步开始安装Python环境 安装Python windows: 1 2 3 4 5 6 7 1.下载安装包     https://www.python.org/downloads/ 2.安装     默认安装路径:C:\python27 3.配置环境变量     [右键计算机]-->[属性]-->[高级系统设置]-->[高级]-->[环境变量]-->[在第二个

python升级安装后的yum的修复

升级python版本号后,执行yum # yum -y install openssl 提演示样例如以下: There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named yum Please install a package which provides this module, or veri

Python virtualenv安装库报错SSL: CERTIFICATE_VERIFY_FAILED

Python virtualenv安装库报错SSL: CERTIFICATE_VERIFY_FAILED 问题描写叙述 使用pip依照virtualenv报错,例如以下: pip install virtualenv Collecting virtualenv /opt/python27/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An

Python如何安装模块

以安装Beautifulsoup4为例: 1.到网站上下载:http://www.crummy.com/software/BeautifulSoup/bs4/download/ 2.解压文件到C:\Python27 3.cmd运行C:\Python27\BeautifulSoup>python setup.py install 4.测试一下是否能导入: >>> import bs4 如果不能导入,会提示:ImportError: No module named bs4 如果是之前的

python之路——python环境安装

下载地址 https://github.com/yyuu/pyenv-installer 安装pyenv 1. 安装git `yum -y install git` 2. 安装pyenv `curl -L` curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash 3. 配置环境变量,在`~/.bash_profile`里增加如下内容 ```bash expor

初学python之安装Jupyter notebook

一开始安装python的时候,安装的是最新版的python3.6的最新版.而且怕出问题,选择的都是默认安装路径.以为这样总不会出什么问题.一开始确实这样,安装modgodb等一切顺利.然而在安装jupyter botebook的时候确出现了问题. 安装mongodb的时候有提示我pip的版本是8.1.2,最新版的是9.0.0,我当时没有更新.昨晚安装jupyter的时候最后出现了exception,不知道怎么解决,网上也没有相关的资料.然后我升级pip,也是类似的exception.迷样的异常搞

Python的安装和详细配置

Python是一种面向对象.解释型计算机程序设计语言.被认为是比较好的胶水语言.至于其他的,你可以去百度一下.本文仅介绍python的安装和配置,供刚入门的朋友快速搭建自己的学习和开发环境.本人欢迎大神拍砖,邮箱:[email protected]sina.com   本博文出处:http://itred.cnblogs.com   欢迎转载,请在显眼处标明文章出处. 安装环境:windows7     64位操作系统 一. 安装包的下载: 网上都能下载到各种版本的python安装包.本人用的是

编程语言Python的安装与使用

我发现学习IT到一定程度避免不了要和编程语言打交道,大学时学习C语言因为老师能力有限,讲得我对此兴趣全无,得过且过的混了过去.不过现在真的感觉有点后悔.只是后悔也没任何用处.那还是学习吧.最近看了许多有关编程语言入门的资料,感觉Python比较适合我.然后就开始学习. 下面分享自己学到的Python的基本知识:安装与使用 本篇文章分三部分: 1,Python的下载 2,Python的安装 3,IDLE基本使用 Python的下载(Linux用户不必下载安装,在安装Linux时已经将Python安

64 位python libxml2安装

1. 显示python没有在注册表中定义 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 # # script to register Python 2.0 or later for use with win32all # and other extens

64位win7,32位python下安装libsvm

先说明一下我的各个版本,电脑win7 64位,python 2.7版本32位,已安装的各种python库都是32位. 所以我这篇文章针对的是以上配置的情况,如果你是64位系统,64位python,请参考 http://blog.csdn.net/lj695242104/article/details/39500039 中.dll文件的获得方法. 我在安装时,被两个error困了一整天,一个是"WindowsError: [Error 193] %1 不是有效的 Win32",另一个是E