Estoy haciendo mi "Hola mundo" en python, les comento que estoy ocupando Kivy para hacer esto pero al momento de ejecutar el programa me sale un error.
import kivy
kivy.require('1.9.0')
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
class Contenedor_01(BoxLayout):
None
class MainApp(App):
title = "Hola mundo"
def build(self):
return Contenedor_01()
if __name__ == '__main__':
MainApp().run(App)
Este es el error que me aparece:
[INFO ] [Logger ] Record log in C:\Users\mxe01508121A.kivy\logs\kivy_17-07-17_5.txt [INFO ] [Kivy
] v1.10.0 [INFO ] [Python ] v3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] [INFO ] [Factory ] 194 symbols loaded [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored) Traceback (most recent call last): File "C:/Users/mxe01508121A/PycharmProjects/untitled1/main.py", line 16, in MainApp().run(App) TypeError: run() takes 1 positional argument but 2 were given
Espero me puedan ayudar un saludo cordial a todos.
Edición:
Trás corregir el problema anterior, según lo indicado en la respuesta de FJSevilla, ahora obtengo el siguiente error:
[INFO ] [Logger ] Record log in C:\Users\mxe01508121A\.kivy\logs\kivy_17-07-17_44.txt
[INFO ] [Kivy ] v1.10.0
[INFO ] [Python ] v3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO ] [OSC ] using <thread> for socket
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] GLEW initialization succeeded
[INFO ] [GL ] Backend used <glew>
[INFO ] [GL ] OpenGL version <b'4.4.0 - Build 20.19.15.4483'>
[INFO ] [GL ] OpenGL vendor <b'Intel'>
[INFO ] [GL ] OpenGL renderer <b'Intel(R) HD Graphics 520'>
[INFO ] [GL ] OpenGL parsed version: 4, 4
[INFO ] [GL ] Shading version <b'4.40 - Build 20.19.15.4483'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[INFO ] [Shader ] fragment shader: <b"WARNING: 0:7: '' : #version directive missing">
[INFO ] [Shader ] vertex shader: <b"WARNING: 0:7: '' : #version directive missing">
[WARNING] [Image ] Unable to load image <C:\Users\mxe01508121A\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\data\glsl\default.png>
[CRITICAL] [Window ] Unable to find any valuable Window provider.
sdl2 - Exception: SDL2: Unable to load image
File "C:\Users\mxe01508121A\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\__init__.py", line 67, in core_select_lib
cls = cls()
File "C:\Users\mxe01508121A\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\window\window_sdl2.py", line 140, in __init__
super(WindowSDL, self).__init__()
File "C:\Users\mxe01508121A\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\window\__init__.py", line 899, in __init__
self.create_window()
File "C:\Users\mxe01508121A\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\window\window_sdl2.py", line 291, in create_window
super(WindowSDL, self).create_window()
File "C:\Users\mxe01508121A\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\window\__init__.py", line 1051, in create_window
self.render_context = RenderContext()
File "kivy\graphics\instructions.pyx", line 758, in kivy.graphics.instructions.RenderContext.__init__ (kivy\graphics\instructions.c:12580)
File "C:\Users\mxe01508121A\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\image\__init__.py", line 538, in __init__
self.filename = arg
File "C:\Users\mxe01508121A\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\image\__init__.py", line 734, in _set_filename
mipmap=self._mipmap, nocache=self._nocache)
File "C:\Users\mxe01508121A\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\image\__init__.py", line 435, in load
im = loader(filename, **kwargs)
File "C:\Users\mxe01508121A\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\image\__init__.py", line 201, in __init__
self._data = self.load(filename)
File "C:\Users\mxe01508121A\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kivy\core\image\img_sdl2.py", line 41, in load
raise Exception('SDL2: Unable to load image')
[CRITICAL] [App ] Unable to get a Window, abort.
python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew