Kivy: Unable to run kivy on raspberry pi with

Created on 26 Apr 2014  Â·  6Comments  Â·  Source: kivy/kivy

HI all,

i get the following when trying trying to run kivy on the raspberry pi with a texy 2.8" colour lcd with touch screen. I have followed the instructions http://kivy.org/docs/installation/installation-rpi.html exactly and all seem to build ok with no errors.

I have tried the dev build and the global build options.

I have tried running from the shell command line and from an xterm in X - same error.

Any ideas? This is raspbian latest everything with texy ammendments found here http://www.raspberrypi.org/forums/viewtopic.php?f=45&t=64993 for the touch screen.

INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_14-04-26_2.txt
[INFO   ] Kivy v1.8.1-dev
[INFO   ] [Python      ] v2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3]
[INFO   ] [Factory     ] 157 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil ignored)
[ERROR  ]
Traceback (most recent call last):
  File "/home/pi/kivy/kivy/lang.py", line 1186, in execute_directives
    mod = __import__('.'.join(package.split('.')[:-1]))
  File "/home/pi/kivy/kivy/extras/highlight.py", line 3, in <module>
    from pygments.lexer import RegexLexer, bygroups, using
ImportError: No module named pygments.lexer
 Traceback (most recent call last):
   File "main.py", line 212, in <module>
     ShowcaseApp().run()
   File "/home/pi/kivy/kivy/app.py", line 773, in run
     self.load_kv(filename=self.kv_file)
   File "/home/pi/kivy/kivy/app.py", line 593, in load_kv
     root = Builder.load_file(rfilename)
   File "/home/pi/kivy/kivy/lang.py", line 1546, in load_file
     return self.load_string(data, **kwargs)
   File "/home/pi/kivy/kivy/lang.py", line 1593, in load_string
     parser = Parser(content=string, filename=fn)
   File "/home/pi/kivy/kivy/lang.py", line 1122, in __init__
     self.parse(content)
   File "/home/pi/kivy/kivy/lang.py", line 1220, in parse
     self.execute_directives()
   File "/home/pi/kivy/kivy/lang.py", line 1197, in execute_directives
     package)
 kivy.lang.ParserException: Parser: File "./showcase.kv", line 2:
 ...
       1:#:kivy 1.8.0
 >>    2:#:import KivyLexer kivy.extras.highlight.KivyLexer
       3:#:import Factory kivy.factory.Factory
       4:
 ...
 Unable to import package 'kivy.extras.highlight.KivyLexer'

regards

Shifters

Most helpful comment

Shouldn't this dependency be actually listed as such? I find it rather annoying that following the official guide on installing Kivy on the RPi you have to dig into the issues on GitHub to find a solution for this problem. After all the demos should be the ones that run without any issues WITH the things that are listed as requirements to get Kivy installed on the system. Please consider adding at least a warning if the required packages for the showcase are not met.

All 6 comments

The Showcase application requires 2 packages more than just Kivy. You are
missing pyglet (Lexer) and probably also docutils. You can install them
with:
sudo pip install pyglet docutils

On Sat, Apr 26, 2014 at 5:36 AM, shifters67 [email protected]:

HI all,

i get the following when trying trying to run kivy on the raspberry pi
with a texy 2.8" colour lcd with touch screen. I have followed the
instructions http://kivy.org/docs/installation/installation-rpi.htmlexactly and all seem to build ok with no errors.

I have tried the dev build and the global build options.

I have tried running from the shell command line and from an xterm in X -
same error.

Any ideas? This is raspbian latest everything with texy ammendments found
here http://www.raspberrypi.org/forums/viewtopic.php?f=45&t=64993 for the
touch screen.

INFO ] [Logger ] Record log in /home/pi/.kivy/logs/kivy_14-04-26_2.txt
[INFO ] Kivy v1.8.1-dev
[INFO ] [Python ] v2.7.3 (default, Mar 18 2014, 05:13:23)
[GCC 4.6.3]
[INFO ] [Factory ] 157 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil
ignored)
[ERROR ]
Traceback (most recent call last):
File "/home/pi/kivy/kivy/lang.py", line 1186, in execute_directives
mod = _import_('.'.join(package.split('.')[:-1]))
File "/home/pi/kivy/kivy/extras/highlight.py", line 3, in
from pygments.lexer import RegexLexer, bygroups, using
ImportError: No module named pygments.lexer
Traceback (most recent call last):
File "main.py", line 212, in
ShowcaseApp().run()
File "/home/pi/kivy/kivy/app.py", line 773, in run
self.load_kv(filename=self.kv_file)
File "/home/pi/kivy/kivy/app.py", line 593, in load_kv
root = Builder.load_file(rfilename)
File "/home/pi/kivy/kivy/lang.py", line 1546, in load_file
return self.load_string(data, *_kwargs)
File "/home/pi/kivy/kivy/lang.py", line 1593, in load_string
parser = Parser(content=string, filename=fn)
File "/home/pi/kivy/kivy/lang.py", line 1122, in *init_
self.parse(content)
File "/home/pi/kivy/kivy/lang.py", line 1220, in parse
self.execute_directives()
File "/home/pi/kivy/kivy/lang.py", line 1197, in execute_directives
package)
kivy.lang.ParserException: Parser: File "./showcase.kv", line 2:
...
1:#:kivy 1.8.0

2:#:import KivyLexer kivy.extras.highlight.KivyLexer
3:#:import Factory kivy.factory.Factory
4:
...
Unable to import package 'kivy.extras.highlight.KivyLexer'

regards

Shifters

—
Reply to this email directly or view it on GitHubhttps://github.com/kivy/kivy/issues/2115
.

Ben Rousch
[email protected]
http://clusterbleep.net/

Many thanks brousch for the quick response.

I have tried the above but still get the same error message. Any ideas?

Tried loading the pictures demo - no error there but also no display either on the mini screen instead it goes to the big screen but at least it works!

I have raised an issue with texy the creator to see if this is a driver issue

regards

Shifters

It needs pygments, not pyglet :) It was a typo of brousch. Kivy itself doesn't require it, except if you use the CodeInput widget. Same for docutils, it is required by the RstDocument widget.

Thanks.

To get it to work:

buildozer.spec:

requirements = kivy,pil,sqlite3,pygments,docutils

Shouldn't this dependency be actually listed as such? I find it rather annoying that following the official guide on installing Kivy on the RPi you have to dig into the issues on GitHub to find a solution for this problem. After all the demos should be the ones that run without any issues WITH the things that are listed as requirements to get Kivy installed on the system. Please consider adding at least a warning if the required packages for the showcase are not met.

Was this page helpful?
0 / 5 - 0 ratings