2012-03-23 01:22:05 +00:00
|
|
|
.. _installation_windows:
|
|
|
|
|
2011-02-01 10:24:24 +00:00
|
|
|
Installation on Windows
|
|
|
|
=======================
|
|
|
|
|
2011-03-16 19:18:07 +00:00
|
|
|
For Windows, we provide what we call a 'portable package'. You don't have
|
|
|
|
to install anything "system" wide. Just unzip & run:
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2012-07-09 20:49:33 +00:00
|
|
|
#. Download the latest version from http://kivy.org/#download
|
2012-03-29 01:31:28 +00:00
|
|
|
|
|
|
|
.. image:: images/win-step1.png
|
2013-04-20 06:35:48 +00:00
|
|
|
:scale: 75%
|
2012-03-29 01:31:28 +00:00
|
|
|
|
|
|
|
#. Unzip the package
|
|
|
|
|
|
|
|
.. image:: images/win-step3.png
|
2013-04-20 06:35:48 +00:00
|
|
|
:scale: 75%
|
2012-03-29 01:31:28 +00:00
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
#. In the folder where you unzipped the package, you have a script called `kivy.bat`.
|
|
|
|
Use this file for launching any kivy application as described below
|
2011-02-01 10:24:24 +00:00
|
|
|
|
|
|
|
|
2011-02-03 15:02:23 +00:00
|
|
|
.. _windows-run-app:
|
|
|
|
|
2011-03-16 19:18:07 +00:00
|
|
|
Start a Kivy Application
|
|
|
|
------------------------
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2011-05-02 18:30:55 +00:00
|
|
|
Send-to method
|
|
|
|
~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
You can launch a .py file with our Python using the Send-to menu:
|
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
#. Copy the kivy.bat file to the Clipboard
|
2012-03-29 01:31:28 +00:00
|
|
|
|
|
|
|
.. image:: images/win-step4.png
|
2013-04-20 06:35:48 +00:00
|
|
|
:scale: 75%
|
2012-03-29 01:31:28 +00:00
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
#. Open Windows explorer (File explorer in Windows 8), and to go the address 'shell:sendto'
|
2012-03-29 01:31:28 +00:00
|
|
|
|
|
|
|
.. image:: images/win-step5.png
|
2013-04-20 06:35:48 +00:00
|
|
|
:scale: 75%
|
2012-03-29 01:31:28 +00:00
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
#. You should get the special Windows directory `SendTo`
|
2012-03-29 01:31:28 +00:00
|
|
|
|
|
|
|
.. image:: images/win-step6.png
|
2013-04-20 06:35:48 +00:00
|
|
|
:scale: 75%
|
2012-03-29 01:31:28 +00:00
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
#. Paste the previously copied kivy.bat file **as a shortcut**
|
2012-03-29 01:31:28 +00:00
|
|
|
|
|
|
|
.. image:: images/win-step7.png
|
2013-04-20 06:35:48 +00:00
|
|
|
:scale: 75%
|
2012-03-29 01:31:28 +00:00
|
|
|
|
|
|
|
#. Rename it to Kivy <kivy-version>
|
|
|
|
|
|
|
|
.. image:: images/win-step8.png
|
2013-04-20 06:35:48 +00:00
|
|
|
:scale: 75%
|
2011-05-02 18:30:55 +00:00
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
You can now execute your application by right clicking on the .py file ->
|
2012-03-29 01:31:28 +00:00
|
|
|
"Send To" -> "Kivy <version>".
|
2011-05-02 18:30:55 +00:00
|
|
|
|
2012-03-29 01:31:28 +00:00
|
|
|
.. image:: images/win-step9.png
|
2013-04-20 06:35:48 +00:00
|
|
|
:scale: 75%
|
2011-05-02 18:30:55 +00:00
|
|
|
|
|
|
|
Double-click method
|
|
|
|
~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
There are some simple steps that you need to complete in order to be able
|
|
|
|
to launch Kivy applications by just double-clicking them:
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
#. Right click on the main Python file (.py file extention) of the application you want to launch
|
2011-03-16 19:18:07 +00:00
|
|
|
#. From the context menu that appears, select *Open With*
|
|
|
|
#. Browse your hard disk drive and find the file ``kivy.bat`` from the portable package. Select it.
|
2013-12-01 08:53:58 +00:00
|
|
|
#. Select "Always open the file with..." if you don't want to repeat this procedure every time you
|
2013-04-16 21:12:09 +00:00
|
|
|
double click a .py file.
|
2011-03-16 19:18:07 +00:00
|
|
|
#. You are done. Open the file.
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2011-03-16 19:18:07 +00:00
|
|
|
The next time you double click a .py file, it will be executed with the version
|
2013-04-16 21:12:09 +00:00
|
|
|
of Python that Kivy ships with.
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2011-03-16 19:18:07 +00:00
|
|
|
.. note::
|
|
|
|
On Windows we have to ship our own version of Python since it's not
|
|
|
|
installed by default on Windows (unlike Mac OS X and Linux). By
|
|
|
|
following the steps above, you will set Kivy's version of Python as the
|
|
|
|
default for opening .py files for your user.
|
|
|
|
Normally this should not be harmful as it's just a normal version of
|
|
|
|
Python with the :ref:`necessary third party libraries <winpackagecontents>`
|
|
|
|
added to the module search path.
|
|
|
|
If you do encounter unexpected problems, please :ref:`contact`.
|
2011-02-01 10:24:24 +00:00
|
|
|
|
|
|
|
|
2013-09-30 13:28:31 +00:00
|
|
|
Start from the Command-line (using bash)
|
|
|
|
----------------------------------------
|
2011-03-16 19:18:07 +00:00
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
If you just want to use or develop with the latest stable Kivy version, this can
|
|
|
|
be achieved using the console. You will need a minimalist GNU system installed.
|
|
|
|
We recommend `msysGit <http://code.google.com/p/msysgit/>`_.
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
When you install msysGit, you must select these options:
|
2011-02-01 10:24:24 +00:00
|
|
|
|
|
|
|
* Don't replace windows shell
|
2011-03-16 19:18:07 +00:00
|
|
|
* Checkout as-is, commit as-is (no CLRF replacement!)
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
You'll have an icon "Git bash" on your desktop. This is the console we want:
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2011-03-16 19:18:07 +00:00
|
|
|
#. Start "Git bash"
|
|
|
|
#. ``cd <directory of portable kivy>``
|
|
|
|
#. ``source kivyenv.sh <full directory path of portable kivy>`` # (don't use .)
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
You are now ready to launch Python/Kivy from the command-line! Just do::
|
2011-02-01 10:24:24 +00:00
|
|
|
|
|
|
|
python <filename.py>
|
|
|
|
|
2011-03-16 19:18:07 +00:00
|
|
|
Also, all other scripts and binaries are available, such as:
|
2011-02-01 10:24:24 +00:00
|
|
|
|
|
|
|
* cython
|
|
|
|
* gcc / make...
|
|
|
|
* easy_install
|
|
|
|
* gst-inspect-0.10
|
|
|
|
|
2013-09-30 13:28:31 +00:00
|
|
|
Start from the Command-line or Double-click (using Python launcher for Windows)
|
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
|
2013-10-05 08:50:55 +00:00
|
|
|
The Python launcher for Windows is available as a separate download
|
|
|
|
from `pylauncher <https://bitbucket.org/vinay.sajip/pylauncher>`_,
|
2013-09-30 13:28:31 +00:00
|
|
|
but is most conveniently installed by simply installing Python 3.3 (or later).
|
|
|
|
Don't worry, this installation is designed to cause minimum disruption, it will run your latest Python 2 by default.
|
|
|
|
|
|
|
|
The launcher defines a ``PY`` command which can launch scripts for any version of Python installed on the workstation.
|
|
|
|
It also connects itself as the default processor for all files with a .py extension.
|
|
|
|
It scans the Python file to see if the first line starts with the string "#!" and, if it does, uses that string to
|
|
|
|
select the appropriate version of Python to run. We will define a customized command so that we can tell it to
|
|
|
|
start the correct version of python for Kivy.
|
|
|
|
|
|
|
|
Create a file named ``py.ini`` and place it either in your users ``application data`` directory, or in ``C:\Windows``.
|
|
|
|
It will contain the path used to start Kivy. I put my Kivy installation at ``C:\utils\kivy`` so my copy says::
|
|
|
|
|
|
|
|
[commands]
|
|
|
|
kivy="c:\utils\kivy\kivy.bat"
|
|
|
|
|
|
|
|
(You could also add commands to start other script interpreters, such as jython or IronPython.)
|
|
|
|
|
|
|
|
Now add a new first line to your ``main.py`` specifying your Python of choice::
|
|
|
|
|
|
|
|
#!/usr/bin/kivy
|
|
|
|
|
|
|
|
You can now launch your Kivy (or any other Python script) either by double-clicking or typing::
|
|
|
|
|
|
|
|
py <filename.py>
|
|
|
|
|
|
|
|
Programs without a ``#!`` first line will continue to be run be the default Python version 2 interpreter.
|
|
|
|
Programs beginning with ``#!/usr/bin/python3`` will launch Python 3.
|
|
|
|
|
|
|
|
The ``/usr/bin`` part will be ignored by the Windows launcher, we add it so that Linux users will also be able to
|
|
|
|
pick a specific Python version. (On my Linux workstation, ``/usr/bin/kivy`` is soft-linked to a virtualenv.)
|
2013-10-05 09:11:15 +00:00
|
|
|
NOTE: In order to work correctly on Linux, your Python file must be saved with Unix-style (LF-only) line endings.
|
2013-09-30 13:28:31 +00:00
|
|
|
|
|
|
|
Full documentation can be found at:
|
2013-12-01 08:53:58 +00:00
|
|
|
`Python3.3 docs <http://docs.python.org/3.3/using/windows.html#launcher>`_ and
|
2013-09-30 13:28:31 +00:00
|
|
|
`PEP 397 <http://www.python.org/dev/peps/pep-0397/>`_.
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2012-07-14 13:54:52 +00:00
|
|
|
Use development Kivy
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
Using the latest development version can be risky and you might encounter
|
|
|
|
issues during development. If you encounter any bugs, please report them.
|
2012-07-14 13:54:52 +00:00
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
If you want to use the latest development version of Kivy, you can follow these steps:
|
2012-07-14 13:54:52 +00:00
|
|
|
|
2013-04-16 21:12:09 +00:00
|
|
|
#. Download and install Kivy for Windows as explained above
|
|
|
|
#. Go into the portable Kivy directory. This contains the `kivy.bat` file and the `Python`, `kivy`, `Mingw` folders etc.
|
2012-07-14 13:54:52 +00:00
|
|
|
#. Rename the kivy directory to kivy.stable
|
2013-04-16 21:12:09 +00:00
|
|
|
#. Go to github, and download the `latest development version of Kivy <https://github.com/kivy/kivy/zipball/master>`_
|
2012-07-14 13:54:52 +00:00
|
|
|
#. Extract the zip into the Kivy portable directory
|
|
|
|
#. Rename the directory named "kivy-<some hash>" to just "kivy"
|
|
|
|
#. Launch kivy.bat
|
|
|
|
#. Go to the Kivy portable directory/kivy
|
|
|
|
#. Type::
|
|
|
|
|
|
|
|
make force
|
|
|
|
|
|
|
|
#. That's all, you have a latest development version!
|
|
|
|
|
2013-07-02 19:24:08 +00:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
If you get errors you may need to upgrade Cython:
|
2013-12-01 08:53:58 +00:00
|
|
|
|
2013-07-02 19:24:08 +00:00
|
|
|
1. Launch kivy.bat
|
2013-08-06 21:50:37 +00:00
|
|
|
2. ``cd Python/Scripts``
|
|
|
|
3. ``pip install --upgrade cython``
|
2012-07-14 13:54:52 +00:00
|
|
|
|
2013-12-01 08:53:58 +00:00
|
|
|
Using an exisiting Python installation (64/32 bit)
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
As an alternative to downloading the kivy distribuation zip file, you can
|
|
|
|
install the kivy requirments into an existing 32 or 64 bit Python installation.
|
|
|
|
For this example we'll assume you have Python installed in ``C:\dev\python27``:
|
|
|
|
|
|
|
|
#. You need a MinGW installation. You can use the MinGW directory included
|
|
|
|
in the kivy distribution or download a fresh MinGW. If you're compiling for 64
|
|
|
|
bit you'll need to the download the 64 bit MinGW.
|
|
|
|
#. If you want to use gstreamer, copy it from the kivy distribution directory.
|
|
|
|
#. Get the kivy.bat file from the kivy distribution, or alternativly set the
|
|
|
|
path and other environmental variables as in the kivy.bat file in order to have
|
|
|
|
a permenant setup. You'll have to execute the fowllowing instructions from this environemt.
|
|
|
|
|
|
|
|
You'll need to edit the paths first to point to the correct python and MinGW
|
|
|
|
locations. If you started with a clean MinGW installation you'll also have to
|
|
|
|
add to the path the location of make.exe if you will be doing any kivy development.
|
|
|
|
#. Download and install distutils and pip. You can install both using the
|
|
|
|
ez_setup.py and get_pip.py files from http://www.pip-installer.org/en/latest/installing.html.
|
|
|
|
#. In ``C:\dev\python27\Lib\distutils`` create a empty ``distutils.cfg`` file.
|
|
|
|
In the file type::
|
|
|
|
|
|
|
|
[build]
|
|
|
|
compiler=mingw32
|
|
|
|
|
|
|
|
#. Download and install cython by typing::
|
|
|
|
|
|
|
|
pip install https://github.com/cython/cython/zipball/master
|
|
|
|
|
|
|
|
#. Download Glew 1.5.7 from http://sourceforge.net/projects/glew/files/glew/.
|
|
|
|
Install the Glew files into the following locations::
|
|
|
|
|
|
|
|
glew32.dll -> ``C:\dev\python27``
|
|
|
|
glew32.dll -> MinGW\lib
|
|
|
|
glew32.lib -> MinGW\lib
|
|
|
|
glew32s.lib -> MinGW\lib
|
|
|
|
glew.h -> MinGW\include\GL
|
|
|
|
glxew.h -> MinGW\include\GL
|
|
|
|
|
|
|
|
#. Download and install the precompiled Pygame 1.9.2 binaries from
|
|
|
|
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame.
|
|
|
|
#. Finally, to install the latest kivy, type::
|
|
|
|
|
|
|
|
pip install https://github.com/kivy/kivy/zipball/master
|
|
|
|
|
|
|
|
Alternativly instead of the githup zipball you can point to a specific
|
|
|
|
kivy zip file. Also, if you have a development version of kivy and want
|
|
|
|
to continue working on it while still installing it you can use the pip
|
|
|
|
--editable switch e.g.::
|
|
|
|
|
|
|
|
pip install --editable C:\dev\kivy
|
|
|
|
|
|
|
|
This will put a link in the site-packages directory pointing to your kivy
|
|
|
|
source, so any changes in the source will be reflected in the install.
|
|
|
|
See here for more details: http://pythonhosted.org/setuptools/setuptools.html#development-mode.
|
|
|
|
|
2011-03-16 19:18:07 +00:00
|
|
|
.. _winpackagecontents:
|
|
|
|
|
|
|
|
Package Contents
|
|
|
|
----------------
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2011-03-16 19:18:07 +00:00
|
|
|
The latest Windows package contains:
|
2011-02-01 10:24:24 +00:00
|
|
|
|
2011-03-16 19:18:07 +00:00
|
|
|
* Latest stable kivy version
|
2011-02-01 10:24:24 +00:00
|
|
|
* Python 2.7.1
|
|
|
|
* Glew 1.5.7
|
|
|
|
* Pygame 1.9.2
|
|
|
|
* Cython 0.14
|
2012-07-04 12:47:21 +00:00
|
|
|
* MinGW
|
|
|
|
* GStreamer
|
2011-02-01 10:24:24 +00:00
|
|
|
* Setuptools
|
|
|
|
|