1. Requirements
Mac OS Mojave
2. Refference
https://kivy.org/doc/stable/installation/installation-osx.html
3. Install Homebrew
xcode-select --install
sudo xcodebuild -license
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
4. Install pyenv
brew install pyenv pyenv-virtualenv
echo 'export PYENV_ROOT="${HOME}/.pyenv"' >> ~/.bash_profile
echo 'export PATH="${PYENV_ROOT}/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
source ~/.bash_profile
5. Install anaconda v3-4.4.0
pyenv install anaconda3-4.4.0
pyenv global anaconda3-4.4.0
6. Install Kivy v1.11.1
brew install pkg-config sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
pip install Cython==0.29.10
pip install Kivy==1.11.1 Kivy-Garden==0.1.4 pygame==1.9.6
7. Sample code
sample.py
import kivy
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App):
def build(self):
return Label(text='Hello world')
if __name__ == '__main__':
MyApp().run()
6. Run sample code
$ python sample.py
[INFO ] [Logger ] Record log in /Users/samurai/.kivy/logs/kivy_19-06-27_1.txt
[INFO ] [Kivy ] v1.11.1
[INFO ] [Kivy ] Installed at "/Users/samurai/.pyenv/versions/anaconda3-4.4.0/lib/python3.6/site-packages/kivy/__init__.py"
[INFO ] [Python ] v3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
[INFO ] [Python ] Interpreter at "/Users/samurai/.pyenv/versions/anaconda3-4.4.0/bin/python"
[INFO ] [Factory ] 184 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL ES 2" graphics system
[INFO ] [GL ] Backend used <sdl2>
[INFO ] [GL ] OpenGL version <b'2.1 INTEL-12.9.22'>
[INFO ] [GL ] OpenGL vendor <b'Intel Inc.'>
[INFO ] [GL ] OpenGL renderer <b'Intel(R) HD Graphics 615'>
[INFO ] [GL ] OpenGL parsed version: 2, 1
[INFO ] [GL ] Shading version <b'1.20'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <16>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[INFO ] [Base ] Start application main loop
[INFO ] [GL ] NPOT texture support is available
[INFO ] [WindowSDL ] exiting mainloop and closing.
[INFO ] [Base ] Leaving application in progress...
Thank you.
last-samurai