问题:

在Ubuntu下使用matplotlib这个库时,运行时出现如下错误:

raise ImportError(str(msg) + ', please install the python3-tk package')
ImportError: No module named '_tkinter', please install the python3-tk package

原因:

从错误提示我们可以看到原因是:是由于python的版本没有包含tkinter的模块,只需要把tk的package安装就可以了。

解决方案:

终端输入命令进行安装:

sudo apt-get install python3-tk

再次运行,就会发现没有错误了。

ubuntu下使用python3的有些库时,解决"raise ImportError(str(msg) + ', please install the python3-tk package') ImportError: No module named '_tkinter', please install the python3-tk package"的错误的更多相关文章

  1. ImportError: No module named _tkinter, please install the python-tk package ubuntu运行tkinter错误

    这是由于Python的版本没有包含tkinter的模块,只需要把tk的package安装就可以了. 一般在Linux才出现,windows版本一般已经包含了tkinter模块. apt-get ins ...

  2. Ubuntu环境下No module named '_tkinter'错误的解决

    在Ubuntu环境下运行下面代码: import matplotlib as plt 出现以下错误: No module named '_tkinter' 解决方法: sudo apt-get ins ...

  3. Ubuntu下 QT添加外部链接库(.so文件)示例

    参考:https://blog.csdn.net/KKALL1314/article/details/81915354 https://forum.qt.io/topic/80301/file-not ...

  4. ubuntu 下编译glew (opengl扩展库)

    最近在研究咋样在QT 下使用opengl 扩展库glew.首先需要明白的是QT中对glut等库进行了封装,但是对glew和glfw等库需要自己编译后使用. 安装步骤: 1.下载Ubuntu下的glew ...

  5. 我在 Ubuntu 下使用 Sublime 编写 python 代码时遇到并解决的问题

    Ubuntu 下 Sublime 无法输入中文 解决方法如下: sudo apt-get update && sudo apt-get upgrade 克隆项目到本地 : git cl ...

  6. 【Linux】CentOS6上安装Python3.7(config、make、make install)及“No module named '_ctypes'”/pip install时“ssl module in Python is not available.”的解决

    1.下载安装包 https://www.python.org/ftp/python/ 该目录下选择所需要的版本进行下载.解压. wget https://www.python.org/ftp/pyth ...

  7. ubuntu下mysql提示Changed limits: max_open_files:1024解决办法

    在配置我的md5解密网站cmd5.la的时候,mysql5.7出现了max_open_files: 1024, max_connections: 214,warning: Changed limits ...

  8. Ubuntu下通过makefile生成静态库和动态库简单实例

    本文转自http://blog.csdn.net/fengbingchun/article/details/17994489 Ubuntu环境:14.04 首先创建一个test_makefile_gc ...

  9. Windows下使用Python的Curses库时 No module named _curses问题

    这个问题产生的 根本原因 是 curses 库不支持 windows.所以我们在下载完成python后(python 是自带 curses 库的),虽然在  python目录\Lib  中可以看到 c ...

随机推荐

  1. Python Django 的学习资料

    十分有用的链接: 链接1:http://www.cnblogs.com/wupeiqi/articles/5433893.html   (银角大王) 链接2:https://www.cnblogs.c ...

  2. POJ 2253

    #include<iostream> #include<stdio.h> #include<math.h> #include<iomanip> #def ...

  3. POJ 1083

    #include<iostream> #include<stdio.h> #include<algorithm> #define MAXN 400 using na ...

  4. linux下安装mysql-5.7.20

    1.下载地址 https://downloads.mysql.com/archives/community/ 2.安装步骤 解压: groupadd mysql useradd -r -g mysql ...

  5. Builder生成器(创建型模式)

    一.使用场景: 1.假设要创建一个House设施,该设施的创建由若干个部分组成,而且这若干个部分经常变化. 如果用最直观的设计方式,每一个房屋部分的变化,都将导致整个房屋结构的重新修正,但是这种设计方 ...

  6. .Net WEB 程序员需要掌握的技能

    原文链接:http://deshui.wang/%E6%8A%80%E6%9C%AF/2015/05/12/net-study-road 基础部分 C# 基础语法 OOP的概念,面向对象的理解 继承 ...

  7. PHP 批量获取 百度搜索结果 网址列表

    <?php set_time_limit(0); function curl($url){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $u ...

  8. linux安装unzip及使用

    安装完linux ,发现没有UNZIP,没办法,重新安装. 1.获取unzip源码 sudo wget http://downloads.sourceforge.net/infozip/unzip55 ...

  9. PHP面向对象常见符号总结($this-> 、self ::)

    转载:http://wyllife.blog.163.com/blog/static/4116390120116223528180/ 在php中常见的对象符号 1.$this this是指向当前对象的 ...

  10. Object-C语言Block的实现方式

    开场白 Block基本概念 中间态转换方法 Block编译后结果分析 Block运行时状态与编译状态对比   开场白   Object-C语言是对C语言的扩展,所以将OC源码进行编译的时候,会将OC源 ...