2015-10-09 02:55:05 +00:00
|
|
|
.. _installation_osx:
|
2012-03-23 01:22:05 +00:00
|
|
|
|
2015-10-09 02:55:05 +00:00
|
|
|
Installation on OS X
|
2011-02-01 10:24:24 +00:00
|
|
|
======================
|
|
|
|
|
2015-10-09 02:55:05 +00:00
|
|
|
Using The Kivy.app
|
|
|
|
------------------
|
|
|
|
|
2011-02-01 10:24:24 +00:00
|
|
|
.. note::
|
|
|
|
|
2015-10-09 02:55:05 +00:00
|
|
|
This method has only been tested on OS X 10.7 Lion 64-bit.
|
2013-12-22 12:27:01 +00:00
|
|
|
For versions prior to 10.7 or 10.7 32-bit, you have to install the
|
2011-02-01 10:24:24 +00:00
|
|
|
components yourself. We suggest using
|
2015-10-09 02:55:05 +00:00
|
|
|
`homebrew <http://brew.sh>`_ to do that.
|
2014-04-16 20:45:03 +00:00
|
|
|
|
2015-10-09 02:55:05 +00:00
|
|
|
For OS X 10.7 and later, we provide a Kivy.app with all dependencies
|
2013-04-13 10:02:03 +00:00
|
|
|
bundled. Download it from our `Download Page <http://kivy.org/#download>`_.
|
2015-10-09 02:55:05 +00:00
|
|
|
It comes as a .dmg file that contains:
|
2011-02-01 10:24:24 +00:00
|
|
|
|
|
|
|
* Kivy.app
|
|
|
|
* Readme.txt
|
|
|
|
* An Examples folder
|
|
|
|
* A script to install a `kivy` command for shell usage
|
|
|
|
|
2011-02-01 20:02:01 +00:00
|
|
|
To install Kivy, you must:
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2012-10-03 01:52:02 +00:00
|
|
|
1. Download the latest version from http://kivy.org/#download
|
2011-02-01 10:24:24 +00:00
|
|
|
2. Double-click to open it
|
|
|
|
3. Drag the Kivy.app into your Applications folder
|
2015-07-07 09:40:36 +00:00
|
|
|
4. Double click the makesymlinks script.
|
|
|
|
|
|
|
|
You should now have a `kivy` script that you can use to launch your kivy app from terminal.
|
|
|
|
|
|
|
|
You can just drag and drop your main.py to run your app too.
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2015-10-09 02:55:05 +00:00
|
|
|
|
2015-07-07 16:17:20 +00:00
|
|
|
Installing modules
|
2015-10-09 02:55:05 +00:00
|
|
|
~~~~~~~~~~~~~~~~~~
|
2015-07-07 16:17:20 +00:00
|
|
|
|
2015-07-17 04:51:55 +00:00
|
|
|
Kivy package on osx uses its own virtual env that is activated when you run your app using `kivy` command.
|
2015-07-07 16:17:20 +00:00
|
|
|
To install any module you need to install the module like so::
|
|
|
|
|
2015-10-09 02:55:05 +00:00
|
|
|
$ kivy -m pip install <modulename>
|
2015-07-17 07:08:15 +00:00
|
|
|
|
2013-04-18 23:50:55 +00:00
|
|
|
|
2011-02-01 20:02:01 +00:00
|
|
|
Start any Kivy Application
|
2015-10-09 02:55:05 +00:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2011-02-01 10:24:24 +00:00
|
|
|
|
|
|
|
You can run any Kivy application by simply dragging the application's main file
|
2013-04-13 06:33:13 +00:00
|
|
|
onto the Kivy.app icon. Just try this with any python file in the examples folder.
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2015-11-21 17:16:53 +00:00
|
|
|
.. _osx-run-app:
|
2011-02-03 15:02:23 +00:00
|
|
|
|
2015-10-09 02:55:05 +00:00
|
|
|
|
2013-04-13 06:33:13 +00:00
|
|
|
Start from the Command Line
|
2015-10-09 02:55:05 +00:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2011-02-01 20:02:01 +00:00
|
|
|
If you want to use Kivy from the command line, double-click the ``Make Symlinks`` script
|
2013-04-13 06:33:13 +00:00
|
|
|
after you have dragged the Kivy.app into the Applications folder. To test if it worked:
|
|
|
|
|
|
|
|
#. Open Terminal.app and enter::
|
2015-10-09 02:55:05 +00:00
|
|
|
|
2013-04-13 06:33:13 +00:00
|
|
|
$ kivy
|
2015-10-09 02:55:05 +00:00
|
|
|
|
2013-04-13 06:33:13 +00:00
|
|
|
You should get a Python prompt.
|
2015-10-09 02:55:05 +00:00
|
|
|
|
2013-04-13 06:33:13 +00:00
|
|
|
#. In there, type::
|
|
|
|
|
2014-01-11 01:07:01 +00:00
|
|
|
>>> import kivy
|
2015-10-09 02:55:05 +00:00
|
|
|
|
2013-04-13 06:33:13 +00:00
|
|
|
If it just goes to the next line without errors, it worked.
|
2015-10-09 02:55:05 +00:00
|
|
|
|
2011-02-01 20:02:01 +00:00
|
|
|
#. Running any Kivy application from the command line is now simply a matter
|
2013-04-13 06:33:13 +00:00
|
|
|
of executing a command like the following::
|
2015-10-09 02:55:05 +00:00
|
|
|
|
2013-04-13 06:33:13 +00:00
|
|
|
$ kivy yourapplication.py
|
2015-10-09 02:55:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
Using pip
|
|
|
|
---------
|
|
|
|
|
|
|
|
Alternatively you can install Kivy using the following steps:
|
|
|
|
|
|
|
|
1. Install the requirements using `homebrew <http://brew.sh>`_::
|
|
|
|
|
|
|
|
$ brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
|
|
|
|
|
|
|
|
2. Install cython 0.21.2 and kivy using pip::
|
|
|
|
|
|
|
|
$ pip install -I Cython==0.21.2
|
2015-11-20 19:52:09 +00:00
|
|
|
$ USE_OSX_FRAMEWORKS=0 pip install git+https://github.com/kivy/kivy.git@1.9.0
|