16

According to this post: https://groups.google.com/forum/?fromgroups#!topic/kivy-users/n7c3thksnzg, it is possible to use Eclipse as an IDE for Kivy through PyDev. However, I didn't understand the instructions. Can anyone please elaborate on how to connect Kivy with Eclipse.

Note: I'm on a Windows machine. Also, is it possible to use PyPy instead of the Python Interpreter?

Thanks~!

GaiusSensei
  • 1,860
  • 4
  • 25
  • 44

6 Answers6

17

Using Kivy with Pydev on Windows xp/7

  • Under Window/Preferences/PyDev/Interpreter-Python add a new interpreter pointing to the python executable which ships with kivy portable
  • add kivy package folder under libraries tab (still in Python Interpreters Prefs section making sure the kivy python interpreter is selected)
  • In Environment tab, add the following three key-value pairs: (assumptions: kivy root is c:\kivy)

    GST_REGISTRY = c:\kivy\gstreamer\registry.bin

    GST_PLUGIN_PATH = c:\kivy\gstreamer\lib\gstreamer-0.10

    PATH = c:\kivy;c:\kivy\Python;c:\kivy\gstreamer\bin;c:\kivy\MinGW\bin;%PATH%

  • When creating a new project intended to use kivy, just specify the appropriate interpreter and you should be ready to go

Rabih Kodeih
  • 9,361
  • 11
  • 47
  • 55
  • 3
    The above instructions are correct for getting Kivy to *run* from PyDev, but what took me ages to figure out was how to get PyDev to find Kivy at edit time. I.e., here is how to get rid of the import errors: **1)** It would seem that you can't have it installed like `C:\Kivy\Kivy-1.4.1`. I was having weird problems getting it working until I moved it to just `C:\Kivy141`. **2)** PyDev doesn't seem to find libraries that are located outside of the Python install directory, so you should either copy `C:\Kivy141\kivy\kivy` into `C:\Kivy141\Python\Lib\site-packages`, or make an equivalent symlink. – Cam Jackson Nov 23 '12 at 04:20
  • 1
    What resolved the issue of PyDev not finding the kivy package and thus flagging `import kivy` as an error was to place kivy in the list of forced builtins in the PyDev editor preferences. – Sven Aug 13 '13 at 13:29
5

I think it's just pointing that:

Fabio Zadrozny
  • 24,814
  • 4
  • 66
  • 78
  • 3
    After poking around (opening the kivy.bat script helped a lot), I figured it all out :) Thanks! Also, It seems that Kivy does not support PyPy yet :( – GaiusSensei Mar 23 '12 at 05:12
  • 1
    Note: just added detailed instructions at: http://pydev.blogspot.com.br/2014/02/configuring-kivy-on-pydev.html for configuring Kivy on PyDev – Fabio Zadrozny Feb 13 '14 at 15:56
4

After following instructions above I was still having problems with imports not found. I found I had to open my project's properties in Eclipse and under "PyDev - PYTHONPATH" add my kivy directory, e.g. C:\Kivy141\kivy

mojoken
  • 1,256
  • 1
  • 15
  • 27
  • I see this post is a year old, but this should REALLY be added to the answer. This not only removed import errors but enabled auto-complete for me. WOOT! – jtsmith1287 Dec 12 '13 at 05:43
3

As of kivy 1.9.0, PATH must also include c:\kivy\SDL2\bin or else when trying to run kivy will throw an error and fail at opening a window. I Think I read that kivy no longer use PyGame and shifted to SDL2 since the answer posted in april 2012.

0

I am using Windows 7 x64 with Eclipse Mars(release 4.5.1). The steps that worked for me(very close to Rabih answer):
1. I copied Kivy 1.9.0 on my local machine from here
2. I renamed the kivy.bat file to python.bat(this step can be ignored)
3. Eclipse->Window->Preferences->PyDev->Interpreters->Python Interpreter->New
and added the python.bat file as interpreter. After doing this the interpreter should look like in the image:enter image description here
4. In the Environement tab add the 3 keys everybody mentioned:
GST_REGISTRY = c:\kivy\gstreamer\registry.bin
GST_PLUGIN_PATH = c:\kivy\gstreamer\lib\gstreamer-0.10
PATH = c:\kivy;c:\kivy\Python;c:\kivy\gstreamer\bin;c:\kivy\MinGW\bin;%PATH%
5. Use the interpreter that you just created in your project. Note that a default one will be selected if you don't specify the one you created

Lucian
  • 874
  • 11
  • 33
0

Using Eclipse IDE with Kivy and Pydev on OS X

  • Type which ivy in the terminal and locate the executable (it should be /usr/local/bin/kivy)
  • Then choose Preferences from Eclipse menu and navigate to PyDev -> Interpreters -> Python Interpreter.
  • Open the Select Interpreter dialog by clicking on the New... button (1) on the right.
  • Fill the name of interpreter (kivy) in the Interpreter Name field (2)
  • Fill the identified path (/usr/local/bin/kivy) in the Interpreter Executable field
  • Press OK and wait till the process will be done.
  • Do not forget to change interpreter settings in your project. You can do it by right click on your project in the Package Explorer under the PyDev - Interpreter/Grammar page.

enter image description here

Community
  • 1
  • 1
karelok
  • 301
  • 2
  • 9
  • I did as you suggested. But when running the app, I get an error that is: File "/Applications/Kivy.app/Contents/Frameworks/python/3.5.0/lib/python3.5/site.py", line 176 file=sys.stderr) ^ SyntaxError: invalid syntax /Applications/Kivy.app/Contents/Resources/script: line 9: /venv/bin/activate: No such file or directory /Applications/Kivy.app/Contents/Resources/script: line 39: /python: No such file or directory /Applications/Kivy.app/Contents/Resources/script: line 39: exec: /python: cannot execute: No such file or directory Can you plz point out what I am missing? – Nadeem Jamali Jul 22 '16 at 13:19