最近,将电脑主机升级到ubuntu16.04,但是需要用到 python-imaging-tk,先是报错:

import PIL.ImageTk as ImageTk
ImportError: No module named ImageTk

参考网上的是pythonimaging-tk的包没有安装,所以

sudo apt-get install python-imaging-tk

但是报错
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-imaging-tk : Depends: python-imaging (= 1.1.7-4ubuntu0.12.04.3) but 3.1.2-0ubuntu1.1 is to be installed
E: Unable to correct problems, you have held broken packages.

我自己也是小白,以前没遇到这个错,只能谷歌啦,但是没谷歌出什么东西,那我就改变检索方式:

python-imaging  3.1.2-0ubuntu1.1

找到一个网页https://launchpad.net/ubuntu/xenial/amd64/python-imaging/3.1.2-0ubuntu1.1,上面说:

PIL used to provide a PIL.pth file which allowed you to `import Image` but
 this is deprecated. Use `from PIL import Image` now, or install this
 compatibility package to temporarily get the old behavior back.
 .
 This compatibility package is built for Python 2 only.

网页还提供deb之类的下载,那我就尝试下载,发现不行,后面又想,我只缺tk模块呀,我单独下载安装就行啦,然后就

谷歌:

python-imaging-tk   3.1.2-0ubuntu1.1

找到这个网页https://ubuntu.pkgs.org/16.04/ubuntu-updates-main-amd64/python-pil.imagetk_3.1.2-0ubuntu1.1_amd64.deb.html

下载了:python-pil.imagetk_3.1.2-0ubuntu1.1_amd64.deb,系统要一致哦,

在终端:$ sudo dpkg -i python-pil.imagetk_3.1.2-0ubuntu1.1_amd64.deb Selecting previously unselected package python-pil.imagetk:amd64.
(Reading database ... 224219 files and directories currently installed.)
Preparing to unpack python-pil.imagetk_3.1.2-0ubuntu1.1_amd64.deb ...
Unpacking python-pil.imagetk:amd64 (3.1.2-0ubuntu1.1) ...
Setting up python-pil.imagetk:amd64 (3.1.2-0ubuntu1.1) ...

大功告成,其实我们有些在sudo apt-get install 找不到相应的版本可以自己安装哈!!!!!感觉自己又获得一个新技能,也从这里看出自己很low!!!!哈哈,没事没事,

每天进步一点点撒!!!

python-imaging-tk : Depends: python-imaging (= 1.1.7-4ubuntu0.12.04.3) but 3.1.2-0ubuntu1.1 is to be installed E: Unable to corre的更多相关文章

  1. Python中Tk模块简单窗口设计

    Python中Tk和PyQt都可以设计小程序,区别在于:Tk界面美观度相对较差,但由于是Python的内置模块,最终生成的程序大小相比于PyQt较小. import tkinter # 导入TKint ...

  2. 【Python】我的Python学习笔记【1】【using Python 2】

    1.模块格式 #!/usr/bin/env python # -*- coding: utf-8 -*- ... ...def main(): ...... ... if __name__=='__m ...

  3. 【Python实战】使用Python连接Teradata数据库???未完成

    1.安装Python 方法详见:[Python 05]Python开发环境搭建 2.安装Teradata客户端ODBC驱动 安装包地址:TTU下载地址 (1)安装TeraGSS和tdicu(ODBC依 ...

  4. Python入门第一课——Python的起源、发展与前景!

    我们在做任何一件事情之前,我们都会通过各种渠道去搜集事情的信息,了解事情的来龙去脉,学习一门编程语言也是如此,只有知根知底,我们才能有明确的方向和目标,以及底气去完成这件事情,今天我带大家来看看Pyt ...

  5. 如何在Windows下开发Python:在cmd下运行Python脚本+如何使用Python Shell(command line模式和GUI模式)+如何使用Python IDE

    http://www.crifan.com/how_to_do_python_development_under_windows_environment/ 本文目的 希望对于,如何在Windows下, ...

  6. python 查询文件修改python lib 库文件

    运行code import os, time import sys import re def search(path, name): for root, dirs, files in os.walk ...

  7. python之初入Python

    python优缺点: Python的优点很多,简单的可以总结为以下几点. 简单和明确,做一件事只有一种方法. 学习曲线低,跟其他很多语言相比,Python更容易上手. 开放源代码,拥有强大的社区和生态 ...

  8. python 3.6 关于python的介绍

    python的官方网站 https://www.python.org/ python 3.6 的官方网站的下载地址 https://www.python.org/downloads/release/p ...

  9. Python开发基础之Python常用的数据类型

    一.Python介绍 Python是一种动态解释型的编程语言.Python它简单易学.功能强大.支持面向对象.函数式编程,可以在Windows.Linux等多种操作系统上使用,同时Python可以在J ...

随机推荐

  1. Jacobi-Anger expansion

    [转载请注明出处]http://www.cnblogs.com/mashiqi 2017/06/16 适合于自己的关于Jacobi-Anger expansion的推导方法,这里记下来,方便以后查阅. ...

  2. IC卡插入与触点激活时序

    当IC卡插入接口设备时,终端应确保其所有触点处于低电平状态: 当IC卡插入接口设备后,触点须按如下方式激活: 要点: 终端必须在整个激活时序中保持RST为低电平状态: 触点物理接触之后,应在IO或CL ...

  3. linux基础之用户登录信息查看命令

    用户登录信息查看命令 1.who命令 同一个账号通过不同终端登录也属于不同的登录信息,这里不同的终端包含虚拟终端和模拟终端,因为一个用户通过一个终端登录属于一个session 基本介绍 打印当前系统上 ...

  4. Spring Boot 非常好的学习资料

    from@https://gitee.com/didispace/SpringBoot-Learning Spring Boot 2.0 新特性学习 简介与概览 Spring Boot 2.0 正式发 ...

  5. 使用outflux 导入influxdb 的数据到timescaledb

    influxdb 以及timescaledb 都是不错的时序数据库,timescaledb 团队提供了直接从influxdb 导入 环境准备 docker-compose 文件 version: &q ...

  6. 监控端口是否开放,端口未开放关闭虚拟ip,端口开放启动虚拟IP

    #!/bin/bash#该脚本监控本机的一个端口,当端口异常时,停止lvs的本地ip直到恢复.该脚本依托于lvs.sh启动脚本#目前只支持监控1个vip #定义常用变量#配置检查的ip以及端口chec ...

  7. Docker Compose(八)

    Docker Compose 是Docker官方编排(Orchstration)项目之一,负责快速在集群中部署分布式应用.   Dockerfile可以让用户管理一个单独的应用容器:而Compose则 ...

  8. JavaScript获取mp4文件MIME编码格式,用于判读是否是h.264,解决在线播放只有声音问题

    测试网址:https://gpac.github.io/mp4box.js/test/filereader.html js库:mp4box.js 不能在线播放的:audio/mp4; codecs=& ...

  9. 计算机信息系统安全保护等级划分准则(GB 17859-1999)

    概述 计算机信息系统安全保护等级划分准则(GB 17859-1999) 1 范围 本标准规定了计算机系统安全保护能力的五个等级,即: 第一级:用户自主保护级: 第二级:系统审计保护级: 第三级:安全标 ...

  10. CentOS 7.2 下nginx SSL证书部署的方法(使用crt以及key 配置)

    转自:https://www.jb51.net/article/107350.htm 环境 系统环境:CentOS6.7 nginx version: nginx/1.8.1 证书 ? 1 2 3 # ...