import pyplot, RuntimeError: Cannot dlopen tkinter module file
Asked Answered
K

1

7

I used pyenv to install pypy in windows bash, then use pip to install matplotlib, but when importing pyplot, I got a RunTimeError

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]:

So what can be the problem, and how to solve this problem?

Any suggestions would be appreciated!

Katrinakatrine answered 30/8, 2016 at 1:23 Comment(0)
U
0

Perhaps something wrong with your python installation. The best ways is delete python and reinstall.

I suggest you install python from Anaconda. It is 'next-click' installer (awesome for windows) which set python path environment variable, and have useful package pre-installed, including 'mathplotlib'.

Upwards answered 11/7, 2017 at 2:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.