ImportError: No module named _tkinter on macos
MAC OS 10.11.6
lMacBook-Pro:~ xiaomilbq$ python
Python 2.7.14 (default, Sep 22 2017, 00:05:22)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter
>>>
理论上Tkinter应该是作为Python的默认设置的啊,网上搜索了各种方法,只有以下的方法管用:
sudo port install py27-tkinter
来自:https://stackoverflow.com/questions/6320954/idle-cant-import-tkinter-your-python-may-not-be-configured-for-tk
里面的一个解答
当然,你需要先安装macport,如果没有的话
后来看了下 是因为之前用macport安装了octave导致python版本配置参数被修改了
因为之前安装了numpy,今天却无法倒入
pip install 命令也不能使用了
ImportError: No module named _tkinter on macos的更多相关文章
- 在绘图的时候import matplotlib.pyplot as plt报错:ImportError: No module named '_tkinter', please install the python-tk package
在绘图的时候import matplotlib.pyplot as plt报错:ImportError: No module named '_tkinter', please install the ...
- ImportError: No module named '_tkinter', please install the python3-tk package
ImportError: No module named '_tkinter', please install the python3-tk package 先更新包,命令:sudo apt-get ...
- 【Linux】`ImportError: No module named '_tkinter'
在centos7 系统下,导入matplotlib时,出现ImportError: No module named '_tkinter'的错误 首先使用以下命令查看模块是否存在 yum list in ...
- 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-t ...
- Python ImportError: No module named '_tkinter', please install the python3-tk package
ImportError: No module named '_tkinter', please install the python3-tk package 这个问题的原因是使用的python3环境内 ...
- ImportError: No module named _tkinter, please install the python-tk package ubuntu运行tkinter错误
这是由于Python的版本没有包含tkinter的模块,只需要把tk的package安装就可以了. 一般在Linux才出现,windows版本一般已经包含了tkinter模块. apt-get ins ...
- centos6.5 导入matplotlib报错 No module named '_tkinter
1.解决方案 在centos系统下,导入matplotlib时,出现ImportError: No module named ‘_tkinter’的错误,首先 yum list installed | ...
- ImportError: No module named 'requests'
补充说明: 当前环境是在windows环境下 python版本是:python 3.4. 刚开始学习python,一边看书一边论坛里阅读感兴趣的代码, http://www.oschina.net/c ...
- python3中用HTMLTestRunner.py报ImportError: No module named 'StringIO'如何解决
python3中用HTMLTestRunner.py报ImportError: No module named 'StringIO'的解决方法: 1.原因是官网的是python2语法写的,看官手动把官 ...
随机推荐
- aws上ecs上tomcat8080端口打开但是无法访问
参考: https://yq.aliyun.com/articles/92050?t=t1 1. 安全组设置 2. 防火墙规则 3. 查看 8080 端口是否绑定到 127.0.0.1上的.如果是 ...
- Python re模块, xpath 用法
1.re正则的用法总结 (1). ^ 表示以哪个字符为开头 eg: '^g' 表示以g开头的字符串 . 表示任意字符 '^g.d' 表示以g开头第二个为任意字符,第三个为b的字 ...
- java项目打包生成MD5文件
之所以发出这篇博客,因为我前几天搞这个问题搞了几天,各种百度居然都没有找到相关的案例,虽然很简单的事件.可是百度博客上面居然都搜不到案例o(* ̄︶ ̄*)o觉得奇怪!!! 新总监来了,项目要上线,以前都 ...
- Cinema CodeForces - 670C (离散+排序)
Moscow is hosting a major international conference, which is attended by n scientists from different ...
- c#一步一步实现ORM
本篇适合新手了解学习orm.欢迎指正,交流学习. 现有的优秀的orm有很多. EF:特点是高度自动化,缺点是有点重. Nhibnate:缺点是要写很多的配置. drapper:最快的orm.但是自动化 ...
- c++ <vector>学习
https://www.cnblogs.com/mr-wid/archive/2013/01/22/2871105.html 具体参考上面博客,很详细,也是看他的.今天c++学习200%,项目开发0% ...
- linux 学习笔记 显示压缩文件 gong.zip 的文件内容
#zip -v gong zip zip info: xxx >删除压缩文件中俄smart.txt 文件 #zip -d gong.zip smart.txt deleting:smart.tx ...
- SpringBoot使用事务
事务是很多项目中需要注意的东西,有些场景如果没有加事务控制就会导致一些脏数据进入数据库,本文简单介绍SpringBoot怎样使用事务. 本文使用的是之前整合JPA的文章,具体可以参考 传送门. 无论是 ...
- 数字进度条组件NumberProgressBar
数字进度条组件NumberProgressBar NumberProgressBar是一款数字进度条组件.它不仅可以通过进度条的变化展现进度,还可以通过跟随文字精确表示进度值.开发者可以对进度条进行 ...
- JavaScript基础笔记(一)基本概念
基本概念 一.语法 一)区分大小写 二)标识符 书写规则同Java 三)注释 略 四)严格模式 1.在整个脚本中启用严格模式:在顶部添加 "use strict" 2.指定函数在严 ...