导入matplotlib.pyplot作为plt失败,错误有关python-tk
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了导入matplotlib.pyplot作为plt失败,错误有关python-tk,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1977字,纯文字阅读大概需要3分钟。
内容图文
![导入matplotlib.pyplot作为plt失败,错误有关python-tk](/upload/InfoBanner/zyjiaocheng/736/ea76baff541740b08c96ed189ea7b7e2.jpg)
我试图导入matplotlib.pyplot,但是收到了与python-tk没有安装有关的错误.它似乎已安装,但我似乎仍然收到错误.任何帮助都会被批评.有关详细信息,请输出如下.非常感谢.
$ipython
Python 2.7.7 (default, Jun 3 2014, 16:16:56)
Type "copyright", "credits" or "license" for more information.
IPython 2.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import numpy as np
In [2]: import matplotlib.pyplot as plt
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-eff513f636fd> in <module>()
----> 1 import matplotlib.pyplot as plt
/usr/lib/pymodules/python2.7/matplotlib/pyplot.py in <module>()
96
97 from matplotlib.backends import pylab_setup
---> 98 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
99
100
/usr/lib/pymodules/python2.7/matplotlib/backends/__init__.pyc in pylab_setup()
26 # imports. 0 means only perform absolute imports.
27 backend_mod = __import__(backend_name,
---> 28 globals(),locals(),[backend_name],0)
29
30 # Things we pull in from all backends
/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py in <module>()
6 import os.path
7
----> 8 import Tkinter as Tk, FileDialog
9
10 # Paint image to Tk photo blitter extension
/usr/lib/python2.7/lib-tk/Tkinter.py in <module>()
40 import _tkinter
41 except ImportError, msg:
---> 42 raise ImportError, str(msg) + ', please install the python-tk package'
43 tkinter = _tkinter # b/w compat for export
44 TclError = _tkinter.TclError
ImportError: libBLT.2.4.so.8.5: cannot open shared object file: No such file or directory, please install the python-tk package
解决方法:
没有这样的文件或目录,请安装python-tk包
使用以下命令安装包:
sudo apt-get install python-tk
内容总结
以上是互联网集市为您收集整理的导入matplotlib.pyplot作为plt失败,错误有关python-tk全部内容,希望文章能够帮你解决导入matplotlib.pyplot作为plt失败,错误有关python-tk所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。