Kivy: Kivy not working on Ubuntu 17.10

Created on 24 Oct 2017  Â·  40Comments  Â·  Source: kivy/kivy

Versions

  • Python: 2.7 and 3.6
  • OS: Ubuntu 17.10
  • Kivy: 1.10
  • Kivy installation method: PPA

Hi,
I have installed kivy in Ubuntu 17.10 and I can't seem to make it work. I have tried many things.
I have tried with Python 2 and 3, and also in a virtual machine.

With this simple app:

from kivy.app import App
App().run()

I get:

[INFO ] [Logger ] Record log in /home/twistx77/.kivy/logs/kivy_17-10-21_1.txt
[INFO ] [Kivy ] v1.10.0
[INFO ] [Python ] v3.6.3 (default, Oct 3 2017, 21:45:48)
[GCC 7.2.0]
Traceback (most recent call last):
File "/home/twistx77/temp/test.py", line 2, in
from kivy.app import App
File "/usr/lib/python3/dist-packages/kivy/app.py", line 319, in
from kivy.base import runTouchApp, stopTouchApp
File "/usr/lib/python3/dist-packages/kivy/base.py", line 30, in
from kivy.event import EventDispatcher
File "/usr/lib/python3/dist-packages/kivy/event.py", line 8, in
import kivy._event
ImportError: /usr/lib/python3/dist-packages/kivy/_event.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf

I have also verified some people in forums are having the same issue.

Most helpful comment

@Twistx77

I've done the same as before with python3.6 and it works for me - uninstalled Cython and python3-kivy and installed both Cython and kivy using pip (not apt-get!) in versions mentioned above. I'm using Ubuntu 17.10

pip3 install Cython==0.23
pip3 install kivy==1.9.1

All 40 comments

Got the same issue with ubuntu 17.10 + kivy 1.10.
Kivy 1.9.1 + python 2.7.14 has a different error all together. I receive this error message
[INFO ] [OSC ] using <multiprocessing> for socket [INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored) X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 4 (X_DestroyWindow) Resource id in failed request: 0x0 Serial number of failed request: 165 Current serial number in output stream: 166
solutions please.
FYI - Opensuse Tumbleweed does the same thing. Kivy just won't run

Me too i had the same problem with python 2.7.14, kivy 1.10.0 and ubuntu 17.10,

Same problem here.

Using Ubuntu 16.04 version is a bad workaround, but Kivy works!!

:-(

Cordiali SalutiFrancesco Cerone
tel. 347 6835437

2017-10-29 11:30 GMT+01:00 Marcus Klein notifications@github.com:

Same problem here.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/kivy/kivy/issues/5453#issuecomment-340252026, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ALEi4VflNryMejJk8G34CBD--GnDkCyOks5sxFPTgaJpZM4QE60X
.

Can confirm I am having the same issues. I have not found a fix yet.

Description: Ubuntu 17.10
Release: 17.10

python3-kivy/artful,now 1.10.0-0~stable0+201708191146~pkg175~ubuntu17.10.1 amd64 [installed]
python3-kivy-bin/artful,now 1.10.0-0~stable0+201708191146~pkg175~ubuntu17.10.1 amd64 [installed,automatic]
python3-kivy-common/artful,now 1.10.0-0~stable0+201708191146~pkg175~ubuntu17.10.1 amd64 [installed,automatic]

I switched back to the Kivy version 1.9.1 provided with Ubuntu 17.10. Furthermore I had to switch my display server from Wayland back to Xorg. When using Wayland, Kivy tries to run with the egl-rpi driver for Raspberry Pi, which does not make sense on a normal amd64 desktop.

I have the same issue, when I try to run a simple kivy example (3D rendering). Kivy is not working

Ubuntu version: 17.10


[INFO ] [Logger ] Record log in /home/susheel/.kivy/logs/kivy_17-11-01_7.txt
[INFO ] [Kivy ] v1.10.0
[INFO ] [Python ] v2.7.14 (default, Sep 23 2017, 22:06:14)
[GCC 7.2.0]
Traceback (most recent call last):
File "main.py", line 15, in
from kivy.app import App
File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 319, in
from kivy.base import runTouchApp, stopTouchApp
File "/usr/lib/python2.7/dist-packages/kivy/base.py", line 30, in
from kivy.event import EventDispatcher
File "/usr/lib/python2.7/dist-packages/kivy/event.py", line 8, in
import kivy._event
ImportError: /usr/lib/python2.7/dist-packages/kivy/_event.x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf

same problem here

user parabolize on irc reported an issue between gnome desktop and sdl2 version, and multisampling support, for these affected by this issue, either of these workaround should work.

  • Use another desktop environment
  • use an sdl2 version between 2.0.5 and 2.0.6
  • disable multisampling in kivy (can be done by editing ~/.kivy/config.ini and setting multisampling to 0)

Please report if it fix the issue for you, if it's multiple different bugs, we should open separate issues.

I tried two of the above:

  • disabling multisampling -> didn't work
  • installing a different desktop environment (XFCE4) -> didn't work either

Same error reported for both.

Hi tshirtman,

I can confirm necrolin's comment.

  • disabling multisampling -> didn't work
  • installing a different desktop environment (Deepin DE) -> didn't work either

Also, I have tried installing package libsdl2-dev in version 2.06 and it is not working either.

Nice nickname by the way haha.

Two different issues. Tchayo see #5476

I can confirm that turning multisamples to zero worked on Ubuntu 17.10. I had previously turned wayland off, but I don't think it made a difference since I had the error before changing the _config.ini_ option.

@rroa That's really interesting. I tried turning multisamples to zero && also disabled wayland however I'm still seeing this error on a fresh install of Ubuntu 17.10 under python 3. So, there must be something else different between our installs.

Again we are talking about two different issues. One is a error importing the event loop the other is a sdl2 issue with unsupported settings (like multi sampling in gnome). If you get a error like what Twistx77 has then you're in the correct place to discuss your issue. If you have a error like Tchayo go to issue #5476.

I confirm that the solution by parabolize on issue #5476, solves the problem for kivy 1.9.1 in ubuntu 17.10

What I don't understand is, how is it possible that the same distro with the same version have a sdl2 problems in some machine and different one in others. Does it has something to do with drivers or something? Aren't both machines working with the same exact software?

i did not upgrade or downgrade sdl2 all I did was this:
disable multisampling in kivy (can be done by editing ~/.kivy/config.ini and settinworg multisampling to 0)
and it worked, so maybe multisampling is the problem!!?!
FYI: this will only work for kivy 1.9.1..refer to issue #5476

Multisampling has been broken in many cases since Kivy moved from Pygame to SDL2, we could not identify the issue so far in Kivy, and it may also be an upsteam bug in SDL2. See https://github.com/kivy/kivy/issues/3576 for example.

I also had an issue with an older graphics card, with Pygame setting multisamples to 8 worked and had a visible effect, while the maximum value which worked in the same env with SDL2 was 4.

Had the same issue. Found that kivy v1.9.1 works with Python v2.7.14, with multisampling set to 0 in ~/.kivy/config.ini , in Ubuntu 17.10.

Thanks @saubhik it works for me too!

Installed Cython==0.23 and kivy==1.9.1 and it works. Didn't change config.
Some dependencies required were probably installed by apt-get as I used it to install (not working version of) python-kivy. I then removed Cython and python-kivy and then installed both with pip in versions previously mentioned (Cython first).

Good luck

I can confirm 1.9.1 works fine with python 2.7 but it doesn't work with 3 even though it doesn't throw the same error I had with 1.10.

I just tried with new installation of Ubuntu 17.10 and I only installed kivy with the PPA provided in kivy's website and installed just this:

sudo apt-get install python-kivy=1.9.1-1build3

@Twistx77

I've done the same as before with python3.6 and it works for me - uninstalled Cython and python3-kivy and installed both Cython and kivy using pip (not apt-get!) in versions mentioned above. I'm using Ubuntu 17.10

pip3 install Cython==0.23
pip3 install kivy==1.9.1

I don't know if it is something I installed or just a Ubuntu update but now I'm getting the same error as before.

Edit:

I have made it work in 17.10 by compiling kivy as instructed by ZenCODE here: https://groups.google.com/forum/#!topic/kivy-users/lRLfxp1Sywg

@Twistx77 I installed via pip into a virtual environment (v1.9.1) and it still seems to work fine even with the system completely up to date. I'm assuming there is some kind of conflict causing this bug on your computer if it suddenly stopped working for you.

By the way, when compiling did you manage to get version 1.10 working? If so, I'll give it a shot too. I tried compiling last week (not using the ZenCODE solution obviously) and it failed to compile for me.

I got kivy working by manually installing it and using the old pygame renderer. A workaround I guess.

Had same issue as Twistx77 on kali light with python 2.7.14 and kivy 1.10.0

Followed BartoszCki solution and got it working.

Had the same Issue on Ubuntu 17.10.

Error:

/Layouts, custom widgets and attributes/stack/stack.py"
Purge log fired. Analysing...
Purge finished!
[INFO   ] [Logger      ] Record log in /home/geistic/.kivy/logs/kivy_18-02-11_88.txt
[INFO   ] [Kivy        ] v1.10.0
[INFO   ] [Python      ] v3.6.3 (default, Oct  3 2017, 21:45:48)
[GCC 7.2.0]
/usr/bin/python3 "/home/geistic/Programming/python/Kivy/Layouts, custom widgets and attributes/stack/stack.py"
 Traceback (most recent call last):
   File "/home/geistic/Programming/python/Kivy/Layouts, custom widgets and attributes/stack/stack.py", line 4, in <module>
     from kivy.app import App
   File "/usr/lib/python3/dist-packages/kivy/app.py", line 319, in <module>
     from kivy.base import runTouchApp, stopTouchApp
   File "/usr/lib/python3/dist-packages/kivy/base.py", line 30, in <module>
     from kivy.event import EventDispatcher
   File "/usr/lib/python3/dist-packages/kivy/event.py", line 8, in <module>
     import kivy._event
 ImportError: /usr/lib/python3/dist-packages/kivy/_event.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf

Everything seems to work after @BartoszCki solution, I can confirm. Tried to install from official ubuntu repositories and afterwards from kivy's, none of it worked.

Uninstall everything:

sudo apt-get remove --purge python3-kivy
sudo pip3 uninstall cython kivy
sudo apt autoremove

Then:

sudo pip3 install Cython==0.23
sudo pip3 install kivy==1.9.1

Works with __Python 3.6.3 (default, Oct 3 2017, 21:45:48)__.

I'm running into this on ubuntu 17.10, but depend on Kivy 1.10 because of RecycleView. Is there an easy way to force PyGame instead of SDL2 ? Would that work around it ?

Is there someone with a solution? I really have to use kivy on ubuntu 17.10?

Check out this: https://groups.google.com/forum/#!topic/kivy-users/lRLfxp1Sywg
This is partial solution and didn't apropriate for production, but for educational purposes looks working.

@0AlphaZero0 While the PPA may not be working on 17.10 right now, I am able to install via virtual environment (see instructions on Kivy website).

Building and installing Kivy from the source seams to work on Ubuntu 18.04 just follow this guide from the docs.

Both for Ubuntu 17.10 and Ubuntu 18.04 the recommendation currently (Mai 2018) is to install from the daily PPA. Building from source works as well, as @OBKF said.

In the comments above it's already mentiond, just to reiterate: On Ubuntu 17.10 there's a bug in a dependency for which the workaround is to change one value in your ~/.kivy/config.ini :

[graphics]
...
multisamples = 0

Confirmed above fix WORKING!

  1. apt-get remove python-kivvy cython
    (for python3 it is python3-kivvy and cython3)
  2. pip uninstall kivvy
  3. pip uninstall cython
  4. pip install cython==0.23
  5. pip install kivy==1.9.1

WORKS !

Ubuntu 16.04.02
Python 2.7.11
pip 10.0.1
cython 0.23
kivy 1.9.1

When running Debian, installing from the PPA works, but above error ("undefined symbol: PyFPE_jbuf") occurs. This comes from the compiler flag "--with-fpectl" which seems to be enabled in Ubuntu 17.10 and Debian.
Installing kivy with pip works around this problem.

Working here (hello world example):
[INFO ] [Kivy ] v1.10.1
[INFO ] [Python ] v3.6.6 (default, Jun 27 2018, 14:44:17)
cython3 0.28.4-1 amd64 C-Extensions for Python 3
Linux 4.15.0-3-amd64 #1 SMP Debian 4.15.17-1 (2018-04-19) x86_64 GNU/Linux

Confirmed above fix WORKING!

  1. apt-get remove python-kivvy cython
    (for python3 it is python3-kivvy and cython3)
  2. pip uninstall kivvy
  3. pip uninstall cython
  4. pip install cython==0.23
  5. pip install kivy==1.9.1

WORKS !

Ubuntu 16.04.02
Python 2.7.11
pip 10.0.1
cython 0.23
kivy 1.9.1

Couldn't install kivy 1.9.1, went with 1.10.1 and still worked! Thanks!

Thoughts

I've confirmed the same error on Debian Buster:

ImportError: /usr/lib/python3/dist-packages/kivy/_event.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf

It is a bit disappointing to find that the standard install instructions simply don't work, especially when the bug was reported over a year ago and the work around is to abandon the install instructions and do something completely different. A change to the install instructions might have been appropriate here. </rant> _and apologies for being blunt_

Likely cause

I believe this is a packaging issue. There appears to be nothing wrong with the code but the process to building and packaging into a *.deb file is broken. The error is indicative of compiling against a different version of a *.so to the one which is being run against.

That fact that apt-get fails to install a working version and pip install is fine (see fath0m's work around) leads me to two _tentative_ theories:

  • the build process is using an older operating system, and is not setup to create multiple versions where newer operating systems have newer libraries installed.
  • the build process is using a pip install setup environment in the mistaken belief that it will work against an apt-get setup.

Alternative fix

If you don't like the approach of using pip install _(people have their reasons)_ then it is possible to build kivy from source without ever touching pip install.
For example for python3:

apt-get install python3
apt-get install cython3
# Results may vary for GL.  Find the package with: apt-cache search libgl1 dev
apt-get install libgl1-mesa-dev
apt-get install libgstreamer1.0-dev
apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev
# I'm happy to edit in additional dependencies if you find them

git clone https://github.com/kivy/kivy.git
cd kivy python3 setup.py build_ext --inplace

The PPA has been updated and is at least building on all the newer OS versions that are available to be built on. 17 does not seem to be listed as a build option (https://code.launchpad.net/~kivy-team/+recipe/kivy-stable/) so I'm not really sure what we can do about this.

It is a bit disappointing to find that the standard install instructions simply don't work

This is a community project, and we don't have the resources to test this on every OS configuration. PRs from the community to fix our build recipes is always welcome.

For what it's worth, I'm seeing this on a Raspbian rig that just underwent an upgrade from Raspbian Stretch to Raspbian Buster.

The underlying error involves what is described here regarding an FPECTL flag as set in Cython. Specifically, this is the best description I've read so far of what's going on. Here is more information about the Floating point exception control module.

Note The fpectl module is not built by default, and its usage is discouraged and may be dangerous except in the hands of experts. See also the section Limitations and other considerations on limitations for more details.

So if I now want to see whether it's turned ON/OFF for my own virtual environment:

(oprint) $ python
Python 2.7.16 (default, Apr  6 2019, 01:42:57) 
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import fpectl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named fpectl

Okay, I can see that the flag wasn't toggled on during the compilation (of Cython, presumably). Technically, I think we're talking about the cpython folder under the Cython install's Includes here in my virtual environment.

As for analyzing what's going on, I have to assume that something in Kivy 1.10.1 in this case was compiled with that flag turned on and my instance has it turned off. (All these so-called "fixes" on the Internet in relation to this error seem to be a lot of hit-and-miss, random attempts to finally find a matchup of OFF/OFF or ON/ON with respect to that flag.)

I note that earlier I had attempted to install numpy but for whatever reasons that didn't work out. Many problems seem to be associated with this module since it probably turns on this flag since it's math-intensive.

My own error as seen is this:

ImportError: /home/pi/oprint/local/lib/python2.7/site-packages/kivy/_event.so: undefined symbol: PyFPE_jbuf

In other words, during Kivy's compilation step with cython (via pip install kivy), the binary file _event.so now has the FPECTL wrappers around one or more of its functions. And yet I note that this flag seems to be OFF for my install.

One of the biggest problems I faced was that pip was trying to reuse its cached versions or to reuse previously-compiled wheels for either.

Works:

pip uninstall kivy
pip uninstall cython
pip install --force-reinstall --no-cache-dir cython==0.28.2
pip install --force-reinstall --no-cache-dir kivy==1.10.1

Running a grep -r . -e 'FPE' in the site-packages folder for the virtual environment FINALLY shows me that no Kivy-related *.so files include that pesky fpectl flag wrapper in the compiled file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KeyWeeUsr picture KeyWeeUsr  Â·  5Comments

damienflament picture damienflament  Â·  3Comments

ghost picture ghost  Â·  3Comments

Michael-F-Bryan picture Michael-F-Bryan  Â·  6Comments

hansent picture hansent  Â·  3Comments