How to install matplotlib for Kivy?

2,156 views
Skip to first unread message

David Aldrich

unread,
Aug 25, 2015, 5:58:29 AM8/25/15
to Kivy users support
Hi

I want to use matplotlib in Kivy so I installed the garden matplotlib package:

garden install matplotlib


I also need to install matplotlib itself. I'm working on 64-bit Windows. I ran the matplotlib installer but it installed to:


C:\Python3.4


whereas I need it in the Kivy path:


"C:\Kivy-1.9.0-py3.4-win32-x64"


but I couldn't change the matplotlib installation path.


Following advice here:


https://groups.google.com/forum/#!searchin/kivy-users/matplotlib/kivy-users/aoSHpwpstLA/KKHnPc6GdH4J


I copied the mpl site_package files from the Python 3.4 installation to the Kivy 3.4 installation but then I see:


Traceback (most recent call last):

  File "backend_kivy.py", line 241, in <module>

    import matplotlib

  File "C:\Kivy-1.9.0-py3.4-win32-x64\Python34\lib\site-packages\matplotlib\__init__.py", line 116, in <module>

    raise ImportError("matplotlib requires dateutil")

ImportError: matplotlib requires dateutil


I think I am hacking rather than following a proper procedure. Please can someone tell me the proper way of installing matplotlib for Kivy 3.4?


Best regards


David



David Aldrich

unread,
Aug 26, 2015, 12:04:29 PM8/26/15
to Kivy users support
Hi

It would be really helpful to have some installation instructions for using MatPlotLib with Kivy.

I am now seeing:

C:\<snip>\gui\garden.matplotlib-master\garden.matplotlib-master\examples>python test_backend.py
 Traceback (most recent call last):
   File "test_backend.py", line 5, in <module>
     from kivy.app import App
   File "C:\Kivy-1.9.0-py3.4-win32-x64\kivy34\kivy\app.py", line 317, in <module>
     from kivy.base import runTouchApp, stopTouchApp
   File "C:\Kivy-1.9.0-py3.4-win32-x64\kivy34\kivy\base.py", line 30, in <module>
     from kivy.event import EventDispatcher
   File "C:\Kivy-1.9.0-py3.4-win32-x64\kivy34\kivy\event.py", line 8, in <module>
     import kivy._event
 ImportError: No module named 'kivy._event'

Any ideas please?

David 

Andrés Vargas

unread,
Sep 1, 2015, 6:55:56 PM9/1/15
to Kivy users support
Hello,

You should try these using the unofficial windows binaries for numpy and matplotlib http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib
garden.matplotlib works with versions greater or equal to 1.9.1 

--
Andres

David Aldrich

unread,
Sep 2, 2015, 5:03:06 AM9/2/15
to Kivy users support
Thanks for the instructions.

David
Reply all
Reply to author
Forward
0 new messages