gpt4 book ai didi

python - 导入 pyplot,运行时错误 : Cannot dlopen tkinter module file

转载 作者:太空狗 更新时间:2023-10-29 21:59:22 27 4
gpt4 key购买 nike

我使用pyenv在windows bash中安装pypy,然后使用pip安装matplotlib,但是当导入pyplot时,我得到了一个运行时错误

In [1]: import matplotlib.pyplot as plt
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-1-eff513f636fd> in <module>()
----> 1 import matplotlib.pyplot as plt

/home/zjshao/.pyenv/versions/pypy-5.3.1/site-packages/matplotlib/pyplot.pyc in <module>()
112
113 from matplotlib.backends import pylab_setup
--> 114 _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
115
116 _IP_REGISTERED = None

/home/zjshao/.pyenv/versions/pypy-5.3.1/site-packages/matplotlib/backends/__init__.pyc in pylab_setup()
30 # imports. 0 means only perform absolute imports.
31 backend_mod = __import__(backend_name,
---> 32 globals(),locals(),[backend_name],0)
33
34 # Things we pull in from all backends

/home/zjshao/.pyenv/versions/pypy-5.3.1/site-packages/matplotlib/backends/backend_tkagg.pyc in <module>()
11
12 # Paint image to Tk photo blitter extension
---> 13 import matplotlib.backends.tkagg as tkagg
14
15 from matplotlib.backends.backend_agg import FigureCanvasAgg

/home/zjshao/.pyenv/versions/pypy-5.3.1/site-packages/matplotlib/backends/tkagg.pyc in <module>()
7 import numpy as np
8
----> 9 from matplotlib.backends import _tkagg
10
11 def blit(photoimage, aggimage, bbox=None, colormode=1):

RuntimeError: Cannot dlopen tkinter module file

In [2]:

那么可能是什么问题,以及如何解决这个问题?

如有任何建议,我们将不胜感激!

最佳答案

也许您的 python 安装有问题。最好的方法是删除 python 并重新安装。

我建议你从 Anaconda 安装 python .它是设置 python 路径环境变量的“next-click”安装程序(对 windows 来说很棒),并预装了有用的包,包括“mathplotlib”。

关于python - 导入 pyplot,运行时错误 : Cannot dlopen tkinter module file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39217479/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com