参考的网址:
User’s Guide » Installation on Windows
Beginning with 1.9.1 we provide binarywheelsfor Kivy and all its dependencies to be used with an existing Pythoninstallation. SeeInstallation.
We also provide nightly wheels generated using Kivymaster. SeeNightly wheel installation.See also Upgrading from a previous Kivy dist. If installing kivy to analternatelocation and not to site-packages, please see Installing Kivy to an alternate location.
Note
For Python < 3.5 we use the MinGW compiler. However, for Python 3.5+ onWindows we currently only support the MSVC compilerbecause of the following Pythonissue 4709 about MinGW.Generally this should make no difference when using precompiled wheels.
To use Kivy you need Python.Multiple versions of Python can be installed side by side, but Kivy needs tobe installed for each Python version that you want to use Kivy.
Installation¶
建议安装的过程中: pip 的时候后面都加上这句: -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Now that python is installed, open the Command line and make surepython is available by typingpython --version
. Then, do the following toinstall.
-
Ensure you have the latest pip and wheel:
python -m pip install --upgrade pip wheel setuptools
-
Install the dependencies (skip gstreamer (~120MB) if not needed, seeKivy’s 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 glewand can be installed with:
python -m pip install kivy.deps.angle
-
Install kivy:
python -m pip install kivy
-
(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 basicexample if you installed the kivy examples:
python share\kivy-examples\demo\showcase\main.py
Note
If you encounter any permission denied errors, try opening theCommand prompt as administratorand trying again.
What are wheels, pip and wheel¶
In Python, packages such as Kivy can be installed with the python packagemanager,pip. Some packages such as Kivyrequire additional steps, such as compilation, when installing using the Kivysource code with pip. Wheels (with a.whl
extension) are pre-builtdistributions of a package that has already been compiled and do not requireadditional steps to install.
When hosted on pypi one installs a wheelusing pip
, e.g.python -m pip install kivy
. When downloading andinstalling a wheel directly, python -m pipinstall wheel_file_name
is used,such as:
python -m pip install C:\Kivy-1.9.1.dev-cp27-none-win_amd64.whl