我正在尝试在我的python 2.7.3上安装QSTK。 (在Windows 10上)。在安装过程中,似乎没有问题,我没有遇到任何错误。但是,当我运行validation.py(here)来检查时,似乎无法导入QSTK.qstkstudu。这是我在运行validation.py时遇到的错误:
已安装QSTK并可导入
[...]
已安装QSTK.qstkutil并可导入
文件" C:\ Python27 \ lib \ site.py",第372行,__ call __
提升SystemExit(代码)
SystemExit:错误:无法导入QSTK.qstkstudy。
有没有人知道我该怎么办?
答案 0 :(得分:1)
产生错误的Validation.py
中的行是:
import QSTK.qstkstudy.EventProfiler
如果你直接在python中试试,你可以看到缺少的东西。就我而言,它是tkinter。
>>> import QSTK.qstkstudy.EventProfiler
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/QSTK-0.2.8-py2.7.egg/QSTK/qstkstudy/EventProfiler.py", line 16, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 114, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/usr/lib/python2.7/dist-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 6, in <module>
from matplotlib.externals.six.moves import tkinter as Tk
File "/usr/lib/python2.7/dist-packages/matplotlib/externals/six.py", line 199, in load_module
mod = mod._resolve()
File "/usr/lib/python2.7/dist-packages/matplotlib/externals/six.py", line 113, in _resolve
return _import_module(self.mod)
File "/usr/lib/python2.7/dist-packages/matplotlib/externals/six.py", line 80, in _import_module
__import__(name)
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in <module>
raise ImportError, str(msg) + ', please install the python-tk package'
ImportError: No module named _tkinter, please install the python-tk package
我在Linux上,所以我做了
sudo apt-get python-tk
Google如何在Windows中安装python tkinter。
祝你好运