[PYTHON] I installed Kivy on a Mac environment

Thing you want to do

Kivy

Kivy is a Python NUI(Natural User Interface)An open source library for multi-touch application development in. The operating environment is Android, iOS, Linux, MacOS X, and Windows. Free open source software distributed under the MIT license.

refs

Being addicted


At pyenv

% pyenv local
3.4.2
% python --version
Python 3.4.2

I couldn't get kivy 1.8.0 smoothly

% pip install kivy
Downloading/unpacking kivy
Running setup.py (path:/private/var/folders/3z/sspq04dx20n3559n0fx1p39w0000gn/T/pip_build_hoge/kivy/setup.py) egg_info for package kivy
Cython is missing, its required for compiling kivy !

Traceback (most recent call last):File "<string>", line 17, in <module>File "/private/var/folders/3z/sspq04dx20n3559n0fx1p39w0000gn/T/pip_build_hoge/kivy/setup.py", line 94, in <module>from Cython.Distutils import build_extImportError: No module named 'Cython'Complete output from command python setup.py egg_info:

Cython is missing, its required for compiling kivy !




Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/var/folders/3z/sspq04dx20n3559n0fx1p39w0000gn/T/pip_build_hoge/kivy/setup.py", line 94, in <module>
from Cython.Distutils import build_ext
ImportError: No module named 'Cython'
----------------------------------------Cleaning up...Command python setup.py egg_info failed with error code 1 in /private/var/folders/3z/sspq04dx20n3559n0fx1p39w0000gn/T/pip_build_hoge/kivy
Storing debug log for failure in /Users/hoge/.pip/pip.log~                                                                                                                                                                                                          

Cython

% pip freeze
Cython==0.21.2

Install the latest version of kivy / 1.9.0

% pip install git+https://github.com/kivy/kivy.git

If you want to install the latest version with pip, can you manage the collection from git? I didn't know this. learn.

pip freeze

% pip freeze
Cython==0.21.2
Kivy==1.9.0-dev
Kivy-Garden==0.1.1
requests==2.5.1

Hello world

I need pygame error

% python test001.py
[WARNING           ] [Config      ] Older configuration version detected (0 instead of 12)
[WARNING           ] [Config      ] Upgrading configuration in progress.
[INFO              ] [Logger      ] Record log in /Users/hoge/.kivy/logs/kivy_15-01-02_0.txt
[INFO              ] Kivy v1.9.0-dev
[INFO              ] [Python      ] v3.4.2 (default, Jan  2 2015, 17:04:28)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]
[INFO              ] [Factory     ] 173 symbols loaded
[INFO              ] [Image       ] Providers: img_tex, img_imageio, img_dds, img_gif (img_pil, img_pygame, img_ffpyplayer, img_sdl2 ignored)
[CRITICAL          ] [Text        ] Unable to find any valuable Text provider at all!
pygame - ImportError: No module named 'pygame'
  File "/Users/hoge/.anyenv/envs/pyenv/versions/3.4.2/lib/python3.4/site-packages/kivy/core/__init__.py", line 57, in core_select_lib
    fromlist=[modulename], level=0)
  File "/Users/hoge/.anyenv/envs/pyenv/versions/3.4.2/lib/python3.4/site-packages/kivy/core/text/text_pygame.py", line 12, in <module>
    import pygame

sdl2 - ImportError: No module named 'kivy.core.text._text_sdl2'
  File "/Users/hoge/.anyenv/envs/pyenv/versions/3.4.2/lib/python3.4/site-packages/kivy/core/__init__.py", line 57, in core_select_lib
    fromlist=[modulename], level=0)
  File "/Users/hoge/.anyenv/envs/pyenv/versions/3.4.2/lib/python3.4/site-packages/kivy/core/text/text_sdl2.py", line 12, in <module>
    from kivy.core.text._text_sdl2 import (_SurfaceContainer, _get_extents,

sdlttf - ImportError: No module named 'kivy.core.text.text_sdlttf'
  File "/Users/hoge/.anyenv/envs/pyenv/versions/3.4.2/lib/python3.4/site-packages/kivy/core/__init__.py", line 57, in core_select_lib
    fromlist=[modulename], level=0)

pil - ImportError: No module named 'PIL'
  File "/Users/hoge/.anyenv/envs/pyenv/versions/3.4.2/lib/python3.4/site-packages/kivy/core/__init__.py", line 57, in core_select_lib
    fromlist=[modulename], level=0)
  File "/Users/hoge/.anyenv/envs/pyenv/versions/3.4.2/lib/python3.4/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.

Install pygame / latest version

pip install hg+http://bitbucket.org/pygame/pygame
## --- snip
gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DENABLE_NEWBUF=1 -I/NEED_INC_PATH_FIX -I/Users/usr0600109/.anyenv/envs/pyenv/versions/3.4.2/include/python3.4m -c src/scrap.c -o build/temp.macosx-10.9-x86_64-3.4/src/scrap.o

src/scrap.c:27:10: fatal error: 'SDL.h' file not found

#include "SDL.h"

         ^

1 error generated.
## --- snip

For pygame

brew install sdl
% pip freeze
Cython==0.21.2
Kivy==1.9.0-dev
Kivy-Garden==0.1.1
pygame==1.9.2a0
requests==2.5.1

This time Hello World

image

Recommended Posts

I installed Kivy on a Mac environment
Building a Python environment on Mac
Create a Python environment on Mac (2017/4)
I installed Linux on my Mac
Create a python environment on your Mac
I built a TensorFlow environment on windows10
Build a Python environment on Mac (Mountain Lion)
Build a Python development environment on your Mac
Create a Python execution environment on IBM i
I installed tensorRT on Ubuntu 18.04
Build a Django development environment using pyenv-virtualenv on Mac
Pyramid + mongodb environment on Mac
Build a machine learning Python environment on Mac OS
I installed ROS on Ubuntu 18.04
I made a Python3 environment on Ubuntu with direnv.
Build a Python development environment on Mac OS X
Build a Python environment on your Mac using pyenv
Build a machine learning environment on mac (pyenv, deeplearning, opencv)
I installed Ubuntu on a USB stick on a dual boot PC
Building a Python environment on a Mac and using Jupyter lab
Build a python data analysis environment on Mac (El Capitan)
Create a virtual environment for python on mac [Very easy]
Building a Python environment on Ubuntu
Anaconda environment construction on Mac (2018 version)
Kivy + Python3 on OSX environment maintenance
I checked Mac Python environment construction
Python environment construction memo on Mac
[Linux] I installed CentOS on VirtualBox
Create a python environment on centos
Environment construction of python3.8 on mac
Build a python3 environment on CentOS7
I tried to create a server environment that runs on Windows 10
I installed Taiga.IO on CentOS7 (I made a script while I was there)
Build a Python environment on your Mac with Anaconda and PyCharm
Django Crispy Tutorial (Environment Building on Mac)
[Super rudimentary] I installed GDAL on Anaconda
Build a python environment on MacOS (Catallina)
I want to build a Python environment
I want to use Linux on mac
Installed aws-cli On Mac OS X Lion
I installed TensorFlow (GPU version) on Ubuntu
Build Python environment with Anaconda on Mac
Install anaconda on a new Mac anyway
Build a Python + OpenCV environment on Cloud9
I started Node.js in a virtual environment
I installed OpenCV-Python on my Raspberry Pi
I tried putting various versions of Python + OpenCV + FFmpeg environment on Mac
I get a firewall warning when I start gqlgen's server.go on my Mac
Create a Python3 environment with pyenv on Mac and display a NetworkX graph
I tried to build a Mac Python development environment with pythonz + direnv
I made a webAPI! Build environment from Django Rest Framework 1 on EC2
Build a LAMP environment on your local Docker
Build a WardPress environment on AWS with pulumi
I want to create a nice Python development environment for my new Mac
I installed Pygame with Python 3.5.1 in the environment of pyenv on OS X
Simply build a Python 3 execution environment on Windows
Build a Django environment on Raspberry Pi (MySQL)
Build a python environment with ansible on centos6
Until a Python inexperienced engineer builds a TensorFlow execution environment + comfortable coding environment on Mac
Building an environment for matplotlib + cartopy on Mac
python on mac