ubuntu下使用python3的有些库时,解决"raise ImportError(str(msg) + ', please install the python3-tk package') ImportError: No module named '_tkinter', please install the python3-tk package"的错误
问题:
在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"的错误的更多相关文章
- ImportError: No module named _tkinter, please install the python-tk package ubuntu运行tkinter错误
这是由于Python的版本没有包含tkinter的模块,只需要把tk的package安装就可以了. 一般在Linux才出现,windows版本一般已经包含了tkinter模块. apt-get ins ...
- Ubuntu环境下No module named '_tkinter'错误的解决
在Ubuntu环境下运行下面代码: import matplotlib as plt 出现以下错误: No module named '_tkinter' 解决方法: sudo apt-get ins ...
- Ubuntu下 QT添加外部链接库(.so文件)示例
参考:https://blog.csdn.net/KKALL1314/article/details/81915354 https://forum.qt.io/topic/80301/file-not ...
- ubuntu 下编译glew (opengl扩展库)
最近在研究咋样在QT 下使用opengl 扩展库glew.首先需要明白的是QT中对glut等库进行了封装,但是对glew和glfw等库需要自己编译后使用. 安装步骤: 1.下载Ubuntu下的glew ...
- 我在 Ubuntu 下使用 Sublime 编写 python 代码时遇到并解决的问题
Ubuntu 下 Sublime 无法输入中文 解决方法如下: sudo apt-get update && sudo apt-get upgrade 克隆项目到本地 : git cl ...
- 【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 ...
- ubuntu下mysql提示Changed limits: max_open_files:1024解决办法
在配置我的md5解密网站cmd5.la的时候,mysql5.7出现了max_open_files: 1024, max_connections: 214,warning: Changed limits ...
- Ubuntu下通过makefile生成静态库和动态库简单实例
本文转自http://blog.csdn.net/fengbingchun/article/details/17994489 Ubuntu环境:14.04 首先创建一个test_makefile_gc ...
- Windows下使用Python的Curses库时 No module named _curses问题
这个问题产生的 根本原因 是 curses 库不支持 windows.所以我们在下载完成python后(python 是自带 curses 库的),虽然在 python目录\Lib 中可以看到 c ...
随机推荐
- Swift 里字符串(四)large sting
对于普通的字符串,对应的_StringObject 有两个存储属性: _countAndFlagsBits: UInt64 _object: Builtin.BridgeObject _countAn ...
- css之IE hack 方法[ IE6 - IE9]
ps: 由于近来需要研究IE下兼容问题,今天又再次翻起起这些针对IE的hack,于是决定写下这篇笔记,记录下这些本该献祭级浏览器下的处理方法,用于备忘 一.IE10以及以下版本均会生效(ie edge ...
- iOS根据图片url获取尺寸
可以在UIImage的分类中加入下面的代码,并且引入系统的ImageIO.framework /** 根据图片的url获取尺寸 @param URL url @return CGSize */ + ( ...
- Code First 数据迁移 转
一.为模型更改设置 Code First 数据迁移 1.工具—>库程序包管理器—>程序包管理器控制台—>输入“Enable-Migrations” 或者 Enable-Migrat ...
- javascript数据结构与算法--基本排序算法(冒泡、选择、排序)及效率比较
javascript数据结构与算法--基本排序算法(冒泡.选择.排序)及效率比较 一.数组测试平台. javascript数据结构与算法--基本排序(封装基本数组的操作),封装常规数组操作的函数,比如 ...
- C# 连接Paradox DB
Paradox数据库是一个成名于15年前的数据库,那时候Borland公司还存在.最近客户提出需求,要在一套用了12年+的应用程序上作些功能更改.这套应用程序使用Delphi+Paradox数据库. ...
- python字符串中包含Unicode插入数据库乱码问题 分类: Python 2015-04-28 18:19 342人阅读 评论(0) 收藏
之前在编码的时候遇到一个奇葩的问题,无论如何操作,写入数据库的字符都是乱码,之后是这样解决的,意思就是先解码,然后再插入数据库 cost_str = json.dumps(cost_info) cos ...
- 【优化】bigpipe技术
一.什么是bigpipe Bigpipe是Facebook工程师提出了一种新的页面加载技术. BigPipe是一个重新设计的基础动态网页服务体系.大体思路是,分解网页成叫做Pagelets的小块,然后 ...
- chrome 下修改 agent 的方法
前言 这篇文章和 tiankonguse 的个人网站里的文章保持同步. 很早之前,在 chrome 下修改 agent 的方法是使用 chrome 插件. 后来 chrome 的某一个版本中自带这个功 ...
- 面试题30:KMP 字符串查找
参考:http://www.ruanyifeng.com/blog/2013/05/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm.html自己写的很简单的K ...