【发布时间】:2018-08-23 08:13:05
【问题描述】:
在 Redhat 7 和 python3.6 上
我可以毫无错误地导入 tkinter:
Python 3.6.5 (default, Jul 25 2018, 21:22:33)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>>
在新的虚拟环境中
Python 3.6.4 (default, Jul 20 2018, 12:22:32)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/ocr1/CRNN_Tensorflow/tkinter/__init__.py", line 36, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
>>>
附:这是一个全新的 virtualenv,由virtualenv <name_of_env> 命令创建。
【问题讨论】:
标签: python-3.x tkinter virtualenv rhel