1

I need to use matplotlib in Python 3.1 under 32bit Windows. That would not be a problem if the version of py was different as there are many binaries of matplotlib for windows(py 3.4 + installed matplolib binary worked great). As I was not able to find a binary for py3.1 I decided to install matplotlib with the help of pip. The highest version to support py3.1 is matplotlib-1.2.1. After googling for a little bit I installed VS2008 and after that the installation successfully completed, however when I tried to plot a simple graph, nothing happened:

import matplotlib.pyplot as plt
plt.plot([1,2,3,4,5])
plt.show()

I found here that the problem may be in the default backend. I decided to fit my graph in a tkinter window but got the following mistake:

from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python31\lib\site-packages\matplotlib\backends\backend_tkagg.py", lin
e 11, in <module>
    import matplotlib.backends.tkagg as tkagg
  File "C:\Python31\lib\site-packages\matplotlib\backends\tkagg.py", line 2, in
<module>
    from matplotlib.backends import _tkagg
ImportError: cannot import name _tkagg

The solution of the error for Fedora and Ubuntu was given in the same topic, but I can not use it for windows. Other topic that I found has the solution only for different linux distributions too. I tried looking for tkinter development packages for windows but unsuccessfully. To be honest, I'm a noob and don't really undersand what a development package is (maybe some libraries or source codes?).

I would be very happy, if someone could help. Thanks in advance.

Community
  • 1
  • 1
Selentiym
  • 11
  • 2

1 Answers1

0

This is very late, and does not directly answer your question, but I'd suggest trying out the Anaconda python distribution. It is an easy to use platform that makes package management in windows relatively painless. I've installed it on quite a few windows computers, and never had any issues with the core science packages that are included by default in the installation. And it is an independent python installation, so you can test it out without interfering with your current python setup.

jdmcbr
  • 5,964
  • 6
  • 28
  • 38