> For the complete documentation index, see [llms.txt](https://docs.kivy.fun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kivy.fun/installation/installation-windows.md).

# Windows

Beginning with 1.9.1 we provide binary [wheels](https://wheel.readthedocs.org/en/latest/) for Kivy and all its dependencies to be used with an existing Python installation. See `install-win-dist`.

We also provide nightly wheels generated using Kivy [master](https://github.com/kivytech/kivy). See `install-nightly-win-dist`. See also `upgrade-win-dist`. If installing kivy to an **alternate location** and not to site-packages, please see `alternate-win`.

Note

For Python < 3.5 we use the MinGW compiler. However, for Python 3.5+ on Windows we currently only support the MSVC compiler because of the following Python [issue 4709](http://bugs.python.org/issue4709) about MinGW. Generally this should make no difference when using precompiled wheels.

To use Kivy you need [Python](https://www.python.org/downloads/windows/). Multiple versions of Python can be installed side by side, but Kivy needs to be installed for each Python version that you want to use Kivy.

## Installation

Now that python is installed, open the `windows-run-app` and make sure python is available by typing `python --version`. Then, do the following to install.

1. Ensure you have the latest pip and wheel:

   ```
   python -m pip install --upgrade pip wheel setuptools
   ```
2. Install the dependencies (skip gstreamer (\~120MB) if not needed, see `kivy-dependencies`):

   ```
   python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
   python -m pip install kivy.deps.gstreamer
   ```

   For Python 3.5 only we additionally offer angle which can be used instead of glew and can be installed with:

   ```
   python -m pip install kivy.deps.angle
   ```
3. Install kivy:

   ```
   python -m pip install kivy
   ```
4. (Optionally) Install the kivy examples:

   ```
   python -m pip install kivy_examples
   ```

   The examples are installed in the share directory under the root directory where python is installed.

That's it. You should now be able to `import kivy` in python or run a basic example if you installed the kivy examples:

```
python share\kivy-examples\demo\showcase\main.py
```

Note

If you encounter any **permission denied** errors, try opening the [Command prompt as administrator](https://technet.microsoft.com/en-us/library/cc947813%28v=ws.10%29.aspx) and trying again.

## What are wheels, pip and wheel

In Python, packages such as Kivy can be installed with the python package manager, [pip](https://pip.pypa.io/en/stable/). Some packages such as Kivy require additional steps, such as compilation, when installing using the Kivy source code with pip. Wheels (with a `.whl` extension) are pre-built distributions of a package that has already been compiled and do not require additional steps to install.

When hosted on [pypi](https://pypi.python.org/pypi) one installs a wheel using `pip`, e.g. `python -m pip install kivy`. When downloading and installing a wheel directly, `python -m pip install wheel_file_name` is used, such as:

```
python -m pip install C:\Kivy-1.9.1.dev-cp27-none-win_amd64.whl
```

## Nightly wheel installation

Warning

Using the latest development version can be risky and you might encounter issues during development. If you encounter any bugs, please report them.

Snapshot wheels of current Kivy master are created on every commit to the master branch of kivy repository. They can be found [here](https://kivy.fun/downloads/appveyor/kivy). To use them, instead of doing `python -m pip install kivy` we'll install one of these wheels as follows.

* Python 2.7, 32bit\_
* Python 3.4, 32bit\_
* Python 3.5, 32bit\_
* Python 3.6, 32bit\_
* Python 2.7, 64bit\_
* Python 3.4, 64bit\_
* Python 3.5, 64bit\_
* Python 3.6, 64bit\_

1. Perform steps 1 and 2 of the above Installation section.
2. Download the appropriate wheel for your system.
3. Install it with `python -m pip install wheel-name` where `wheel-name` is the name of the renamed file and add deps to the PATH.

Kivy examples are separated from the core because of their size. The examples can be installed separately on both Python 2 and 3 with this single wheel:

* Kivy examples\_

## Kivy's dependencies

We offer wheels for Kivy and its dependencies separately so only desired dependencies need be installed. The dependencies are offered as optional sub-packages of kivy.deps, e.g. `kivy.deps.sdl2`.

Currently on Windows, we provide the following dependency wheels:

* [gstreamer](https://gstreamer.freedesktop.org) for audio and video
* [glew](http://glew.sourceforge.net/) and/or [angle (3.5 only)](https://github.com/Microsoft/angle) for OpenGL
* [sdl2](https://libsdl.org) for control and/or OpenGL.

One can select which of these to use for OpenGL use using the KIVY\_GL\_BACKEND envrionment variable by setting it to glew (the default), angle, or sdl2. angle is currently in an experimental phase as a substitute for glew on Python 3.5 only.

gstreamer is an optional dependency which only needs to be installed if video display or audio is desired. ffpyplayer is an alternate dependency for audio or video.

## Command line

Know your command line. To execute any of the `pip` or `wheel` commands, one needs a command line tool with python on the path. The default command line on Windows is [Command Prompt](http://www.computerhope.com/issues/chusedos.htm), and the quickest way to open it is to press Win+R on your keyboard, type `cmd` in the window that opens, and then press enter.

Alternate linux style command shells that we recommend is [Git for Windows](https://git-for-windows.github.io/) which offers a bash command line as [well](http://rogerdudler.github.io/git-guide/) as [git](https://try.github.io). Note, CMD can still be used even if bash is installed.

Walking the path! To add your python to the path, simply open your command line and then use the `cd` command to change the current directory to where python is installed, e.g. `cd C:\Python27`. Alternatively if you only have one python version installed, permanently add the python directory to the path for [cmd](http://www.computerhope.com/issues/ch000549.htm) or [bash](http://stackoverflow.com/q/14637979).

## Use development Kivy

Warning

Using the latest development version can be risky and you might encounter issues during development. If you encounter any bugs, please report them.

To compile and install kivy using the kivy [source code](https://github.com/kivytech/kivy/archive/master.zip) or to use kivy with git rather than a wheel there are some additional steps:

1. Both the `python` and the `Python\Scripts` directories **must** be on the path. They must be on the path every time you recompile kivy.
2. Ensure you have the latest pip and wheel with:

   ```
   python -m pip install --upgrade pip wheel setuptools
   ```
3. Get the compiler. For Python < 3.5 we use mingwpy as follows.

   1. Create the `python\Lib\distutils\distutils.cfg` file and add the two lines:

      ```
      [build]
      compiler = mingw32
      ```
   2. Install MinGW with:

      ```
      python -m pip install -i https://pypi.anaconda.org/carlkl/simple mingwpy
      ```

   For Python 3.5 we use the MSVC compiler. For 3.5, [Visual Studio 2015](https://www.visualstudio.com/downloads/) is required, which is availible for free. Just download and install it and you'll be good to go.

   Visual Studio is very big so you can also use the smaller, [Visual C Build Tools instead](https://github.com/kivytech/kivy/wiki/Using-Visual-C---Build-Tools-instead-of-Visual-Studio-on-Windows).
4. Set the environment variables. On windows do:

   ```
   set USE_SDL2=1
   set USE_GSTREAMER=1
   ```

   In bash do:

   ```
   export USE_SDL2=1
   export USE_GSTREAMER=1
   ```

   These variables must be set everytime you recompile kivy.
5. Install the other dependencies as well as their dev versions (you can skip gstreamer and gstreamer\_dev if you aren't going to use video/audio):

   ```
   python -m pip install cython docutils pygments pypiwin32 kivy.deps.sdl2 \
   kivy.deps.glew kivy.deps.gstreamer kivy.deps.glew_dev kivy.deps.sdl2_dev \
   kivy.deps.gstreamer_dev
   ```
6. If you downloaded or cloned kivy to an alternate location and don't want to install it to site-packages read the next section.
7. Finally compile and install kivy with `pip install filename`, where `filename` can be a url such as `https://github.com/kivytech/kivy/archive/master.zip` for kivy master, or the full path to a local copy of a kivy.

### Compile Kivy

1. Start installation of Kivy cloned from GitHub:

   ```
   python -m pip install kivy\.
   ```

If the compilation succeeds without any error, Kivy should be good to go. You can test it with running a basic example:

```
python share\kivy-examples\demo\showcase\main.py
```

## Installing Kivy to an alternate location

In development Kivy is often installed to an alternate location and then installed with:

```
python -m pip install -e location
```

That allows Kivy to remain in its original location while being available to python, which is useful for tracking changes you make in Kivy for example directly with Git.

To achieve using Kivy in an alternate location extra tweaking is required. Due to this [issue](https://github.com/pypa/pip/issues/2677) `wheel` and `pip` install the dependency wheels to `python\Lib\site-packages\kivy`. So they need to be moved to your actual kivy installation from site-packages.

After installing the kivy dependencies and downloading or cloning kivy to your favorite location, do the following:

1. Move the contents of `python\Lib\site-packages\kivy\deps` to `your-path\kivy\deps` where `your-path` is the path where your kivy is located.
2. Remove the `python\Lib\site-packages\kivy` directory altogether.
3. From `python\Lib\site-packages` move **all** `kivy.deps.*.dist-info` directories to `your-path` right next to `kivy`.

Now you can safely compile kivy in its current location with one of these commands:

```
> make
> mingw32-make
> python -m pip install -e .
> python setup.py build_ext --inplace
```

**If kivy fails to be imported,** you probably didn't delete all the `*.dist-info` folders and and the kivy or `kivy.deps*` folders from site-packages.

## Making Python available anywhere

There are two methods for launching python on your `*.py` files.

### Double-click method

If you only have one Python installed, you can associate all `*.py` files with your python, if it isn't already, and then run it by double clicking. Or you can only do it once if you want to be able to choose each time:

1. Right click on the Python file (.py file extension) of the application you want to launch
2. From the context menu that appears, select *Open With*
3. Browse your hard disk drive and find the file `python.exe` that you want to use. Select it.
4. Select "Always open the file with..." if you don't want to repeat this procedure every time you double click a .py file.
5. You are done. Open the file.

### Send-to method

You can launch a .py file with our Python using the Send-to menu:

1. Browse to the `python.exe` file you want to use. Right click on it and copy it.
2. Open Windows explorer (File explorer in Windows 8), and to go the address 'shell:sendto'. You should get the special Windows directory SendTo
3. Paste the previously copied `python.exe` file **as a shortcut**.
4. Rename it to python \<python-version>. E.g. `python27-x64`

You can now execute your application by right clicking on the .py file -> "Send To" -> "python \<python-version>".

## Upgrading from a previous Kivy dist

To install the new wheels to a previous Kivy distribution all the files and folders, except for the python folder should be deleted from the distribution. This python folder will then be treated as a normal system installed python and all the steps described in `Installation` can then be continued.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kivy.fun/installation/installation-windows.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
