-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Using Visual C Build Tools instead of Visual Studio on Windows
MSVC is used mainly to support Python 3.5 and higher versions. To compile for Python 3.5 there's more than one tool to use for compilation although the actually used compiler is basically the same. Visual C++ Build Tools is the smallest one among all of them. If you already have Visual Studio 2015 you do not need this guide and can instead compile normally.
-
Get Visual C++ Build Tools (~5GB total size) and install the following components from the "visual c++ build tools" section: "Windows 10 SDK (version)", "Visual C++ tools for CMake", "C++/CLI support", "VC++ 2015.3 v14.00 (v140) toolset for desktop)".
-
Open
cmd.exe
in <python.exe folder> (shift + right click) -
Upgrade pip and setuptools*
-
Get sdl2 and glew DLLs and headers:
python -m pip install kivy.deps.sdl2 kivy.deps.glew python -m pip install kivy.deps.sdl2_dev kivy.deps.glew_dev :: optionally install GStreamer + headers python -m pip install kivy.deps.gstreamer kivy.deps.gstreamer_dev
-
Then Run
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
or for VS 2019
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat"
Add you architecture as the first argument (find it using
--help
) -
Set environment variables for compiler:
set MSSdk=1 set DISTUTILS_USE_SDK=1 set LIB=%cd%\libs;%LIB% set INCLUDE=%cd%\include;%INCLUDE%
-
Set environment variables for Kivy:
set USE_SDL2=1 set USE_GSTREAMER=0 :: optionally set USE_GSTREAMER=1
-
git clone https://github.com/kivy/kivy
*The setuptools Python package version must be at least 24.0. according to Python's wiki