There appears to be a multi-step process to install Kivy on Windows. Isn't the whole point of pip to not have to worry about that?
I was expecting "pip install kivy" > "python helloworld.py" > done
Instead I got "install these things", "if you're using this version install this other thing", "cool now install kivy".
I went ahead and tried to package a Windows app using their recommended method (PyInstaller), and PyInstaller doesn't support current version of Python.
Thought I'd take a look at other offerings, for iOS there's a weird project-mirror XCode generator script. Android isn't any better.
I mean, this is more of a reflection on the disparity across different platforms and packaging tools rather than Kivy itself. There's a reason some large Enterprises won't touch all of these tiny, moving, fragile tech.
In saying all of that, I think Kivy has some very nice points. The examples are straightforward, and to-the-point, covering a lot of use cases. However I think having this as a >1.0 versioned release is kind of crazy. When comparing this to other frameworks, why would you ever choose this? Aside from "I like Python"? Definitely shows a lot of promise, but I think sitting in sub 1 state for a while like Rust until you've got something going for you would help with adoption and on-boarding.
EDIT: Tried to use PyInstaller from source, no luck - SDL required. Found a closed bug report which explains how to fix it - the "optional" library has to be installed for PyInstaller to work. Go figure. https://github.com/kivy/kivy/issues/4482
Python with c modules (kivy relies heavily on cython) is still a bit tricky on windows. But binary wheels have made distribution a bit easier - ideally "pip install kivy" should work, for now I think the easiest path is to download relevant wheels, install dependencies with pip, and then install the relevant wheel (pip install kivy-version.whl). I did at least get it to work fairly easily following the instructions at:
I work with Kivy in Windows at work using pip. I tried binary wheels but manually installing can be tricky with windows, but not impossible.
Kivy and its modules install fine using Kivy with me. The issues I had were setting up the correct path variables in Windows.
You need Python\Scripts and Python in your Windows path like so:
C:\Python34\Scripts;C:\Python34;
Please note, another issue you might run into is if you have two different version of Python on your machine. You might already have an older versions of python and not realize it, which can make setting it up difficult.
I had to take Python 2.7 out of my path, and Windows seems to only want one version in it's path at a time, from my limited experience.
Work Firewalls (obvious but some people still report troubles for installing due to this when its not a python issue or Kivy issue, just a work environment)
depending on your work environment (I assume anyone working with Windows is doing it because they have to due to work environments) you will need to potentially (with sys admin approval of course) install by bypassing a firewall.
I work at an extremely locked down secure environment and the only issues I had installing Kivy and its modules were working with my IT department to work with security protocols and firewalls, and I'm running Windows 7 even.
I highly recommend Kivy for desktop only based Apps and it renders some beautiful phone apps as well. I am looking into electron for desktop apps too, but I did alot of research on this and Kivy is a really good option even over qt in my opinion.
The only issue I have is its lack of ability to do node based plotting. It's more of a physics engine based environment and good for Dashboard settings and real time chronological plotting, music apps, interactive games as it has an embedded webgl library and touchscreen binding events.
There is a matplotlib module but honestly who wants a screen shot of a matlab plot in Kivy?
You can install NetworkX with WebGL but it is outdated for Python 3.4
On my long list of todos is getting a node based graphing module wrapped for Kivy.
if you will be continuing to develop in Kivy, I highly recommend r/kivy. It's moderators are alive, well and responsive and it is a good community for Kivy dev.
Note that python3.4 is pretty old - in particular 3.5 fixed a few things - and 3.6 has been out a little while. So for anyone else that's coming into this for the first time, I'd recommend the latest stable, official python (3.6.1 at the time of this writing). The official python is built with/works with Visual Studio (the community version works fine) - and with hooking off "add python to path" in the python installer along with first installing Microsoft Visual studio command line build tools/compiler -- most regular python packages should install nicely with with pip.
For your own sanity, please do use "virtual environments" (venvs) -- now officially part of python:
python -m venv kivy-venv
Will create a python3 venv in a folder called "kivy-venv" -- that can be activated in powershell via the script: "kivy-venv\Scripts\Activate.ps1". Then commands like "pip" will be run in the context of that venv, and not mess with system python.
For reasons I don't fully understand, the official python binary on all other platforms, post python 3, is "python3", while on windows it remains "python". This leads to some additional conflicts on windows if both python 2 an 3 are installed.
You can also install python in your user profile - and if you do so, running the default installed pip outside of an activated python virtual environment will mess up your install (and/or fail).
Always use a venv when doing anything in python. The only exception is if you're creating your own linux/os distribution, and want python to power part of your distribution tooling (eg: the package manager, like "apt").
My biggest caveat is the kV lang, when you get to dynamic components you almost always have to either give up and do the ugly manual bindings by hand, or hardcode a lot of values.
In the same vein, I'm curious about the workflow and tooling here. Being used to Visual Studio+XAML kind of WYSIWYG editing, is there anything similar in Kivy? Or do you write code, run app, close app, repeat?
I put together a photo booth using Kivy and use it occasionally at weddings. I was able to get the inital project going in a weekend, but I've been maintaining it for a few years.
I'd use Kivy for another project, and reccomend it. That's not to say it's perfect, but overall it is enjoyable to use.
It utilizes OpenGL and you can bind those objects to your own user defined physics with resources and actions, much like javascript binds to events.
you can see the WebGL shapes objects and components they have in the Kivy library, which is very nicely documented online.
OpenGl and Kivy are opensource so you should be able to make a wrapper module install, which would be similiar to an npm package in javascript, for Kivy, which would be a combination of Python and OpenGL if you wanted to create your own SDL components.
Used Kivy for Desktop-GUI for one of my oss-project. It was quite easy to learn and create (if you already know python). Much easier/quicker then creating GTK+ application. (created GTK+ GUI long time ago, not sure whether things changed recently)
When I tried to use it to make Android apps, unfortunately, apps are slow and needs more disk-space.I also had trouble creating packages with Buildozer.I wanted to avoid Java at all cost, but left with no-other option to go with Java for Android.
If you plan to start with Kivy, use their pre-built VM to avoid installation steps.
The apps are not slow, the problem is initialization. From what I gathered from talking to various core devs the interpreter is to blame and there's no solution for it.
I just started playing with this a couple of days ago.
I use conda on Windows, and it installed without any issue.
It's pretty easy to get started and crank out a usable UI. My toy app isn't sophisticated (service status for one service :) ), but it only took a couple of hours to whip together. It works fine, and looks pretty.
In contrast, I've used the Qt bindings for awhile, and they took a bit more effort for the same results.
I can't speak to the performance, or the cross-platform capability. For a quick and dirty utility it worked just fine, and I can see doing larger things with it.
I've never used Kivy. Is it really all that great?
I mean, the last time I looked at it, it seemed like it has a lot of moving parts that are all pretty heavy that you could just use directly if you really wanted to and still get similar results. Like how they were (didn't check if they still are) using pygame to interface with SDL to do rendering a lot of other things. I've seen other projects that used pygame on mobile devices that were able to do it without all of the extra complexity that Kivy layers on. Pygame isn't that hard to use, so if I know how to use it, why would I use Kivy?
> Like how they were (didn't check if they still are) using pygame to interface with SDL to do rendering a lot of other things.
Kivy only ever used Pygame for SDL's backend management, drawing has always used OpenGL. We actually no longer use Pygame by default, having moved instead to SDL2. There are also alternative backends for almost everything, e.g. a direct X11 window backend on Linux, or the rpi window backend that does not require X.
> I've seen other projects that used pygame on mobile devices that were able to do it without all of the extra complexity that Kivy layers on
Do you have any examples? I'm aware of almost none, or any active build tools for Pygame. I've been wondering if the best way to use Pygame on Android would be via pygame_sdl2 using Renpy or python-for-android, but it would be nice to find an alternative.
> all of the extra complexity that Kivy layers on. Pygame isn't that hard to use, so if I know how to use it, why would I use Kivy?
I'm not sure what is meant by 'extra complexity' unless you're referring to Kivy itself being an extra module to install. Kivy isn't a Pygame wrapper, but its own toolkit with a very different, OpenGL based drawing API. It's probably also more performant, especially when optimised (e.g. KivEnt http://kivent.org/). Even ignoring performance etc., you'd want to use Kivy if you just prefer how it works (but you don't have to feel that way).
Beyond this, Kivy doesn't just have the graphics API but an entire widget toolkit. It also directly supports both Android and iOS, although as above perhaps I'm not aware of current Pygame efforts.
>Kivy only ever used Pygame for SDL's backend management, drawing has always used OpenGL. We actually no longer use Pygame by default, having moved instead to SDL2. There are also alternative backends for almost everything, e.g. a direct X11 window backend on Linux, or the rpi window backend that does not require X.
Ahh, OK. I'll have to check that again. It's been more than a few years since I last looked at it. I guess though I did find the idea of using pygame just for SDL to be kind of... blunt. Though there weren't very many other good python to SDL wrappers (which is like, not all of what pygame is used for).
>> I've seen other projects that used pygame on mobile devices that were able to do it without all of the extra complexity that Kivy layers on
>Do you have any examples? I'm aware of almost none, or any active build tools for Pygame. I've been wondering if the best way to use Pygame on Android would be via pygame_sdl2 using Renpy or python-for-android, but it would be nice to find an alternative.
I was actually thinking of Renpy or python-for-android. Again, my initial impressions about this are several years old, and I didn't actually get that far past the initial evaluation of it for what I was thinking of using it for before moving on to other projects.
> I'm not sure what is meant by 'extra complexity' unless you're referring to Kivy itself being an extra module to install. Kivy isn't a Pygame wrapper, but its own toolkit with a very different, OpenGL based drawing API. It's probably also more performant, especially when optimised (e.g. KivEnt http://kivent.org/). Even ignoring performance etc., you'd want to use Kivy if you just prefer how it works (but you don't have to feel that way).
I think I didn't at the time, because I already felt kind of comfortable with how SDL/pygame did things. But I should look into that again.
>Beyond this, Kivy doesn't just have the graphics API but an entire widget toolkit. It also directly supports both Android and iOS, although as above perhaps I'm not aware of current Pygame efforts.
Yeah, I didn't need the widgets at the time either, and mobile was only a secondary concern. I should look at Kivy again one of these days...
> I guess though I did find the idea of using pygame just for SDL to be kind of... blunt
Yeah, I think this was a pragmatic choice (it was before I was involved at all), but it was never that great. SDL2 has solved a lot of problems and is much easier to support.
> I was actually thinking of Renpy or python-for-android.
python-for-android is Kivy's own Android build tool, which nowadays is a separate project. It supports multiple backends, but doesn't really support pygame except as a Kivy backend (which is not maintained much any more). It does support SDL2, so you can use e.g. PySDL2 to make Android apps.
I think Renpy also moved to SDL2, probably also due to issues supporting Pygame, although last I checked they use a fork of Kivy's older python-for-android toolchain.
Kivy has embedded Opengl, and is really easy to learn. You can make dashboards extremely easy, and video games with working physics engines in less than twenty minutes. Overall, its basic settings are beautiful.
I havn't used Pygame but I don't consider Kivy to be heavy with alot of moving parts at all. Not to mention, unlike many Python libraries and platforms, this one has good documentation. Defined but simple and no handwaving techniques.
if you are familiar with Javascript, Kivy employs similiar callback like ideas, but not specific mechanism, to animate physics engines based on WebGL, which bind very nicely to it's widget resources.
In fact, if I had to choose a platform in which to teach middle school aged kids to code video games, Kivy would be it.
That being said, I've only used it for a desktop app kind of like in sandbox a environment. But in regards to your heavy comments, when it comes to Python, I honestly have to say anything build in Python when it comes to any type of SDL rendering, even scaled webapps, are limited for distributed systems and exponential scaling.
Python is great for learning, and college apps, and even dynamic languages for high level engineering analysis but when it comes to scaling for webapps or in maybe your case you are talking about RAM and power usage for phone apps, anything with Python is generally never a top choice.
If you think Kivy is hard, I recommend downloading it and going through one of their two tutorials, a ping pong game and a paint app.
I honestly can't see how you would think its heavy or overly complicated unless you are not familiar with widgets, or graphics period.
in general, OpenGl and WebGl is a definite win over strictly javascript based graphical rendering so if that is the gap that makes it complex, read up on OpenGl and WebGL because that is where the future is going even on the web.
Yeah, I didn't get the sense that it was hard or overly complicated in the sense that I couldn't understand it. It was more that my impression was Kivy was adding quite a bit more than I wanted for the project I was considering using it for. So when deciding between, SDL2 in C/C++ (which I could totally do, but this was a side project for fun, so would I really want to if I didn't have to?), Pygame (which didn't support SDL2 at the time, which was a small problem), some of the other smaller python game libraries which look dead now, and Kivy, I didn't necessarily see the point in using Kivy if mobile wasn't a priority for me, which it wasn't.
I was expecting "pip install kivy" > "python helloworld.py" > done
Instead I got "install these things", "if you're using this version install this other thing", "cool now install kivy".
I went ahead and tried to package a Windows app using their recommended method (PyInstaller), and PyInstaller doesn't support current version of Python.
Thought I'd take a look at other offerings, for iOS there's a weird project-mirror XCode generator script. Android isn't any better.
I mean, this is more of a reflection on the disparity across different platforms and packaging tools rather than Kivy itself. There's a reason some large Enterprises won't touch all of these tiny, moving, fragile tech.
In saying all of that, I think Kivy has some very nice points. The examples are straightforward, and to-the-point, covering a lot of use cases. However I think having this as a >1.0 versioned release is kind of crazy. When comparing this to other frameworks, why would you ever choose this? Aside from "I like Python"? Definitely shows a lot of promise, but I think sitting in sub 1 state for a while like Rust until you've got something going for you would help with adoption and on-boarding.
EDIT: Tried to use PyInstaller from source, no luck - SDL required. Found a closed bug report which explains how to fix it - the "optional" library has to be installed for PyInstaller to work. Go figure. https://github.com/kivy/kivy/issues/4482