Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem whit from kivy.garden.matplotlib.backend_kivyagg import FigureCanvasKivyAgg on windows #61

Closed
juanjpnv opened this issue Oct 3, 2018 · 3 comments

Comments

@juanjpnv
Copy link

juanjpnv commented Oct 3, 2018

When I import the garden.matplotlib package i recive a error mensage:
ImportError: cannot import name 'weight_as_number' from 'matplotlib.font_manager'

I used the Python in the Command Prompt to import step-by-step. I find a error in the garden.matplotlib import line.

System: Windows 10, Python 3.7.0, Kivy 1.10.1

>>> import matplotlib
Backend TkAgg is interactive backend. Turning interactive mode on.

>>> matplotlib.use('module://kivy.garden.matplotlib.backend_kivy')

>>>from kivy.garden.matplotlib.backend_kivyagg import FigureCanvasKivyAgg
[INFO ] [Logger ] Record log in C:\Users\user.kivy\logs\kivy_18-10-03_7.txt
[INFO ] [Kivy ] v1.10.1
[INFO ] [Python ] v3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)]
Traceback (most recent call last):
File "", line 1, in
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.2\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 20, in do_import
module = self.system_import(name, *args, **kwargs)
File "D:\Documents\venv\lib\site-packages\kivy\garden_init
.py", line 100, in load_module
return self.load_module(fullname, moddir)
File "D:\Documents\venv\lib\site-packages\kivy\garden_init
.py", line 104, in _load_module
('', '', imp.PKG_DIRECTORY))
File "C:\Python37-32\lib\imp.py", line 245, in load_module
return load_package(name, filename)
File "C:\Python37-32\lib\imp.py", line 217, in load_package
return load(spec)
File "C:\Users\user.kivy\garden\garden.matplotlib_init
.py", line 1, in
from kivy.garden.matplotlib.backend_kivy import FigureCanvasKivy,
File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.2\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\user.kivy\garden\garden.matplotlib\backend_kivy.py", line 257, in
from matplotlib.font_manager import weight_as_number
ImportError: cannot import name 'weight_as_number' from 'matplotlib.font_manager' (D:\Documents\venv\lib\site-packages\matplotlib\font_manager.py)

@xstreck1
Copy link
Contributor

xstreck1 commented Oct 9, 2018

Hi, I had the same issue. This is due to incompatibility with matplotlib 3.0.0+ .

I've created a fork that fixes the issue and requested a pull.

In the meantime you can either get the new source here: https://github.com/xstreck1/garden.matplotlib or downgrade matplotlib to 2.2.2 .

@matham
Copy link
Member

matham commented Oct 9, 2018

Fixed by #62.

@matham matham closed this as completed Oct 9, 2018
@juanjpnv
Copy link
Author

juanjpnv commented Oct 9, 2018

I downgrade matplotlib to 2.2.2 and it's solved.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants