Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

KeyError: 'kivy.garden.graph' while importing graph flower

243 views
Skip to first unread message

Andrea Merello

unread,
Mar 20, 2020, 11:44:54 AM3/20/20
to Kivy users support
Hello,

I'm failing importing the 'graph' flower, even in a minimal example; as soon as I try to do

from kivy.garden.graph import Graph

I got this error:

Traceback (most recent call last):
   File "main.py", line 20, in <module>
     from kivy.garden.graph import Graph, MeshLinePlot
   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
   File "<frozen importlib._bootstrap>", line 628, in _load_backward_compatible
 KeyError: 'kivy.garden.graph'

I run Ubuntu 18.04.4 and I use python3 and virtualenv. This happens with both graph pip-installed version and latest from github

Steps to reproduce:

virtualenv foo -p /usr/bin/python3
source foo/bin/activate
pip install kivy
pip install kivy_garden.graph
echo "from kivy.garden import Graph" > foo.py
python3 foo.py


Complete output:
[INFO   ] [Logger      ] Record log in /home/andrea/.kivy/logs/kivy_20-03-20_51.txt
[INFO   ] [Kivy        ] v1.11.1
[INFO   ] [Kivy        ] Installed at "/home/andrea/tmp/foo/lib/python3.6/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.6.9 (default, Nov  7 2019, 10:44:02)
[GCC 8.3.0]
[INFO   ] [Python      ] Interpreter at "/home/andrea/tmp/foo/bin/python3"
 Traceback (most recent call last):
   File "foo.py", line 1, in <module>
     from kivy.garden import Graph
   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
   File "<frozen importlib._bootstrap>", line 628, in _load_backward_compatible
 KeyError: 'kivy.garden.Graph'


Thanks for any help,
Andrea

Robert Flatt

unread,
Mar 20, 2020, 9:13:23 PM3/20/20
to Kivy users support
pip3 ?

Andrea Merello

unread,
Mar 23, 2020, 3:11:55 AM3/23/20
to Kivy users support
It doesn't make any difference; I get the same outcome..

Andrea

Andrea Merello

unread,
Mar 23, 2020, 5:47:04 AM3/23/20
to Kivy users support
It turned out that the instruction from the graph flower page are outdated, and that the correct syntax to import flowers has changed.

The solution is to do:

from kivy_garden.graph import Graph
Reply all
Reply to author
Forward
0 new messages