kivy-garden/garden.matplotlib

ModuleNotFoundError: No module named 'kivy.garden.matplotlib.backend_kivyagg'

Patricklevyy opened this issue · 3 comments

Hello, is there any incompatibility between a kivy garden matplotlib and pyinstaller? I have a kivy application that uses the module kivy.garden.matplotlib.backend_kivyagg. When I test my program it works fine but once converted into an executable (.exe) I get this error below. I'm using a virtual environment and I've checked that the module is correctly installed. I also run the pyinstaller command in the same viral environment.

Traceback (most recent call last):
  File "main.py", line 6, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "myapp\load_data_app.py", line 11, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "myapp\curve_drawing.py", line 5, in <module>
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'kivy.garden.matplotlib.backend_kivyagg'

I use:

Kivy==2.2.1
Kivy-Garden==0.1.5
kivy-garden.graph==0.4.0
kivy-matplotlib-widget==0.6.1
kivymd==1.1.1
matplotlib==3.7.2
pyinstaller==5.6.2

Thank you for your help.

mp-007 commented

kivyagg is for kivy-garden matplotlib library and it's not install in your environnement. kivy-matplotlib-widget is an other library and you don't need to import kivy.garden.matplotlib.backend_kivyagg with this library.

Thanks, I found the solution, I was using an old version of pyinstaller and also a bad command line to do it.