How to use Kivy 1.9.0 with PTVS 2.2?

651 views
Skip to first unread message

David Aldrich

unread,
Jun 5, 2015, 8:03:38 AM6/5/15
to kivy-...@googlegroups.com
Hi

Does anyone have notes they can share for how to run Kivy 1.9.0 with PTVS 2.2 under Visual Studio please?

Best regards

David

Kunjan Chauhan

unread,
Jun 23, 2015, 8:14:02 PM6/23/15
to kivy-...@googlegroups.com
David, Did you get anywhere with this?  I am currently trying to figure this out as well. Rgds, KC

David Aldrich

unread,
Jun 24, 2015, 4:05:37 AM6/24/15
to kivy-...@googlegroups.com
Hi Kunjan

I haven't got any further. Did you see these, fairly old, instructions for earlier versions of Kivy and PTVS?

David Aldrich

unread,
Jun 25, 2015, 6:07:59 AM6/25/15
to kivy-...@googlegroups.com
Just to say I think I have Kivy 1.9.0 with PTVS 2.2 working now.

It's necessary to:

  1. Add a Kivy environment to PTVS
  2. Add that Kivy environment to your Visual Studio PTVS project
  3. Add a search path to your project to point to Kivy, e.g. "C:\Kivy-1.9.0-py3.4-win32-x64\kivy34"
  4. Add the following to the top of your source file:

import os

os.environ['GST_PLUGIN_PATH'] = r"C:\Kivy-1.9.0-py3.4-win32-x64\gstreamer\lib\gstreamer-1.0"

os.environ['GST_REGISTRY'] = r"C:\Kivy-1.9.0-py3.4-win32-x64\gstreamer\registry.bin"

os.environ['PATH'] = r"C:\Kivy-1.9.0-py3.4-win32-x64;C:\Kivy-1.9.0-py3.4-win32-x64\Python34;C:\Kivy-1.9.0-py3.4-win32-x64\tools;C:\Kivy-1.9.0-py3.4-win32-x64\Python34\Scripts;C:\Kivy-1.9.0-py3.4-win32-x64\gstreamer\bin;C:\Kivy-1.9.0-py3.4-win32-x64\MinGW\bin;C:\ProgramData\Oracle\Java\;%PATH%"


(adapted as necessary for your environment).


David Aldrich

unread,
Jun 25, 2015, 8:22:47 AM6/25/15
to kivy-...@googlegroups.com
Actually, the environment variables I specified above appear not to be correct. I can't run my Kivy app if those 'os...' lines are included. So needs more investigation.

However, the good news is that PTVS 2.2 provides a way to specify environment variables in project properties. So, if we could identify the correct settings, we could specify those in PTVS without modifying the source code.


Carsten Thielepape

unread,
Jun 25, 2015, 8:41:37 AM6/25/15
to kivy-...@googlegroups.com
Hi David,

where do you struggle?

To Compile/Run/Start?
To Debug?
Intellisense?

David Aldrich

unread,
Jun 25, 2015, 8:47:12 AM6/25/15
to kivy-...@googlegroups.com
Intellisense is fine. Debugging is the problem.

Carsten Thielepape

unread,
Jun 25, 2015, 9:03:12 AM6/25/15
to kivy-...@googlegroups.com
Funny: Intellisense (The kivy part) is not working for me, but the code/debug works fine: that's how I did it:

I start the VS form a batch

cd \dev\Kivy27
call kivy-2.7.bat ../dummy.py

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe"



Where dummy.py is just an empty file preventing the command interpreter to get closed.

Installed the vstools for python addon
added a Python environment

Prefix path: c:\dev\Kivy27\Python27
Press autodetect
Apply
And it should work

btw: works for 3.4 as well

Kunjan Chauhan

unread,
Jun 25, 2015, 9:06:40 AM6/25/15
to kivy-...@googlegroups.com
Hi David:

See https://www.youtube.com/watch?v=KY1GEOo3qy0&list=PLReL099Y5nRdLgGAdrb_YeTdEnd23s6Ff&index=11 for details on customizing environments and installing Pypi packages from within VS2015.  Using this VS2015 can see Kivy and tries to install it but fails as it needs Cython.  VS2015 sees Cython within Pypi, but fails throwing the following: error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat).  Regards, kc

David Aldrich

unread,
Jun 25, 2015, 9:15:29 AM6/25/15
to kivy-...@googlegroups.com
To get Intellisense working you need to add the Kivy environment and, possibly, the Search path for kivy. Did you try that?

David Aldrich

unread,
Jun 25, 2015, 9:17:09 AM6/25/15
to kivy-...@googlegroups.com
I may be wrong, but I don't think you should be installing Kivy in VS. Install Kivy as normal, from the command line, then add a Kivy Python environment in VS.

Kunjan Chauhan

unread,
Jun 25, 2015, 9:34:55 AM6/25/15
to kivy-...@googlegroups.com
So I started out by taking the route you mention and then discovered that VS2015/PTVS2.2 is already hooked into Pypi using pip.  This means that it should apply all the settings you mention and then there is athe added advantage of setting up virtual environments etc.  I managed to upgrade pygame and pip using this functionality.  It would make life much easier if it worked.  I feel it's worth exploring and if it doesn't work, I'll revert back to plan a / your suggestion...!

David Aldrich

unread,
Jun 25, 2015, 9:37:29 AM6/25/15
to kivy-...@googlegroups.com
Let us know how you get on.

Carsten Thielepape

unread,
Jun 25, 2015, 9:40:08 AM6/25/15
to kivy-...@googlegroups.com
Adding a kivy environment in VS did the trick. Thanks!

Kunjan Chauhan

unread,
Jun 25, 2015, 10:51:47 AM6/25/15
to kivy-...@googlegroups.com
Gents, well I got fed up and ran under cmd:

pip install "Kivy-1.9.0-cp34-none-win32.whl"

This installed kivy 190, kivy garden 011 and requests 270.

Then I opened up VS2015RC, navigated to Python Environments.  Updated the database so intellisense etc works and also updated Kivy-garden to 0.1.4 from within VS2015. 

Everything works...!  I did not have to manually configure any paths or search strings.

My environment is now:

32bit: vs2015rc, ptvs 2.2rc, python343,

and my pip listing within vs2015rc states I have the following:

kivy 190, kivy garden 014, pip 703, pygame 192a0, requests 270, setuptools 18.0.1 and six 1.9.0




Reply all
Reply to author
Forward
0 new messages