tkinter # If this fails your Python may not be configured for Tk解决方法
来源:互联网 发布:淘宝限定皮肤cdk哪来的 编辑:程序博客网 时间:2024/05/20 00:12
今天在Python中画图,用的是matplot,结果执行的时候出现这个错误。
tkinter其实是Python调用tcl程序的标准Python程序,可以通过这个interface调用tcl的程序,因为在大多数的unix系统中都内置了很多的tcl程序和命令。
Tcl 是“工具控制语言(Tool Command Language)”的缩写,其面向对象为otcl语言。Tk 是 Tcl“图形工具箱”的扩展,它提供各种标准的 GUI 接口项,以利于迅速进行高级应用程序开发。
解决办法是:
1.先安装tk和tcl
安装tk>> sudo apt install python3-tk (Ubuntu)>> yum install python3-tk (Centos)安装tk开发类库:>> sudo apt install python3-tk (Ubuntu)>> yum install python3-tk (Centos)
2.重新编译python3
cd Python-3.6.2./configure --with-ssl //为了能正常使用pip,需要重新编译sslmakesudo make install
最后进入python3中导入tkinter,显示正常
>>python3>>>import tkinter
问题解决
参考:http://www.jianshu.com/p/0baa9657377f
阅读全文
0 0
- tkinter # If this fails your Python may not be configured for Tk解决方法
- python3安装提示** IDLE can't import Tkinter. Your Python may not be configured for Tk. **
- Tk:perl/Tk, TCL/Tk, python/Tk(Tkinter)示例
- 编译错误:A class file was not written. The project may be inconsistent, if so try refreshing this projec
- A class file was not written. The project may be inconsistent, if so try refreshing this project and
- " 'this' may not be used in this context"
- 出现This error can be caused by a virtual directory not being configured as an application...解决方法
- Clock skew detected. Your build may be incomplete.解决方法
- vsftpd: not configured for standalone, must be started from inetd
- vsftpd: not configured for standalone, must be started from inetd
- This installation has not been configured properly for Software Updates
- Gradle settings for this project are not configured yet
- The security key for this program currently stored on your system does not appear to be valid for th
- Python:WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable.
- Your build may be incomplete
- VS 安装助手,弹出“The security key for this program currently stored on your system does not appear to be ”
- VS 安装助手,弹出“The security key for this program currently stored on your system does not appear to be ”
- Unable to logon to the server. Your login credentials not be configured properly (-12)".
- Java方法的可变参数个数
- leetcode 650. 2 Keys Keyboard 最小复制粘贴次数 + 深度优先遍历DFS
- location配置介绍
- curl的简单使用
- 8皇后问题
- tkinter # If this fails your Python may not be configured for Tk解决方法
- Python 函数 类
- HTML页面布局
- java 简单排序
- 学习日记-Git快速教程
- PowerDesigner最基础的使用方法入门学习
- 为什么新生代内存需要有两个Survivor区
- 生成webservice接口以及通过客户端调用接口。
- Hdoj 1263 水果