[Help Needed] Kivy causing python.exe crash when creating a texture on windows 10/surface pro 4

288 views
Skip to first unread message

David Hazlett

unread,
Nov 27, 2015, 11:58:42 AM11/27/15
to Kivy users support
Hi everybody,

I'd appreciate any advice on this.  I have a few Kivy programs complete but I'm trying something new with textures and I'm getting a python.exe crash on the Texture.create() call.  In my larger program I'm trying to manipulate a numpy array and visualize it as a texture but here is my simple example that is crashing.

Environment:

Tested with freshly downloaded copies of both Kivy-1.9.0-py2.7-win32-x86 and Kivy-1.9.0-py2.7-win32-x64
Windows 10 Home x64 on Microsoft Surface Pro 4
Following test program test.py:

import kivy
kivy.require('1.0.5')
from kivy.app import App
from kivy.graphics.texture import Texture
class MainApp(App):
    def build(self):
        self.main_console = MainConsole()
        self.main_console.build()
        return self.main_console
class MainConsole():
    def build(self):
        texture = Texture.create()
if __name__ == '__main__':
    MainApp().run()

When I execute this code python will crash on the line texture=Texture.create().  I have tried a number of different options (instance variable, using ObjectProperty, etc) but essentially any manipulation where I use the Texture class I get a crash - even if I'm extracting a texture from an existing Image.

I would appreciate any help..

Thanks,
Dave

OPQ

unread,
Nov 27, 2015, 12:03:45 PM11/27/15
to Kivy users support
did you provide a size ? 
Texture.create(size=(100,100)) ? 

Alexander Taylor

unread,
Nov 27, 2015, 12:04:18 PM11/27/15
to Kivy users support
This is (probably) because you instantiate the Texture before the opengl context is created. Doing 'from kivy.core.window import Window' first will probably fix it.

David Hazlett

unread,
Nov 27, 2015, 12:41:29 PM11/27/15
to Kivy users support
Alexander,

That worked, thank you very much!  Many hours spent on this one :) 

Thanks,
Dave
Message has been deleted

Oliver Spencer

unread,
Jun 11, 2017, 6:28:41 AM6/11/17
to kivy-...@googlegroups.com
Hi,
I've added the import statement as above, however now two Kivy windows seem to load, the correct one, and also a blank one that crashes whenever the kivy.core.window import is used. Any ideas?

Thanks

On Sunday, 11 June 2017 11:23:13 UTC+1, Oliver Spencer wrote:
Hi,

I'm trying to do the same thing, however when I import 'from kivy.core.window import Window', I end up getting the Windows OpenGL error re-appearing despite the work-around of deactivating multisamples in Windows (see https://github.com/kivy/kivy/issues/3576). Is there any way to stop this happening?

Thanks,

Oliver.
Reply all
Reply to author
Forward
0 new messages