I followed the steps below to install kivy on virtualenv (Mac OSX) with sdl2 support
$ brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
$ pip install -I Cython
$ USE_OSX_FRAMEWORKS=0 pip install kivy
but when trying to run basic documentation code
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
class LoginScreen(GridLayout):
def __init__(self, **kwargs):
super(LoginScreen, self).__init__(**kwargs)
self.cols = 2
self.add_widget(Label(text='User Name'))
self.username = TextInput(multiline=False)
self.add_widget(self.username)
self.add_widget(Label(text='password'))
self.password = TextInput(password=True, multiline=False)
self.add_widget(self.password)
class MyApp(App):
def build(self):
return LoginScreen()
if __name__ == '__main__':
MyApp().run()
I got the following error
[INFO ] [Logger ] Record log in /Users/manthansharma/.kivy/logs/kivy_16-08-25_68.txt
[INFO ] [Kivy ] v1.9.1
[INFO ] [Python ] v3.5.2 (default, Aug 16 2016, 05:35:40)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)]
[INFO ] [Factory ] 179 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_imageio, img_dds, img_gif (img_pygame, img_pil, img_ffpyplayer ignored)
[CRITICAL ] [Text ] Unable to find any valuable Text provider at all!
pygame - ImportError: No module named 'pygame'
File "/Users/manthansharma/virtualenvs/kivy/lib/python3.5/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/Users/manthansharma/virtualenvs/kivy/lib/python3.5/site-packages/kivy/core/text/text_pygame.py", line 12, in <module>
import pygame
pil - ImportError: No module named 'PIL'
File "/Users/manthansharma/virtualenvs/kivy/lib/python3.5/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/Users/manthansharma/virtualenvs/kivy/lib/python3.5/site-packages/kivy/core/text/text_pil.py", line 8, in <module>
from PIL import Image, ImageFont, ImageDraw
[CRITICAL ] [App ] Unable to get a Text provider, abort.
I also tried specifying the sdl2.dylib path in KIVY_SDL2_PATH, but did not get any result, but using kivy.app works fine, but I want to use virtualenv