Eclipse + PyDev + Kivy: bogus error msg on Property import

956 views
Skip to first unread message

BobB

unread,
Apr 11, 2013, 8:21:54 PM4/11/13
to kivy-...@googlegroups.com
I set up Eclipse with PyDev and followed Cam Jackson's very helpful How-To including checks for import errors:

http://www.ocularsoftware.com/2012/11/how-to-use-pydev-to-develop-and-run-kivy-applications-on-windows/

Everything worked well with super simple examples but now I'm adding a Kivy ObjectProperty and getting an import error for that import only.

from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty       <----- "Unresolved import" error here only
from kivy.vector import Vector

But the good news is that the error is bogus.  The .py and .kv files work together to produce the desired result.
Anyone else experiencing this?
BobB

Thomas Pietrowski

unread,
Apr 12, 2013, 4:45:07 AM4/12/13
to kivy-...@googlegroups.com
Have you installed it on Windows? Well, in that case you might forget to compile some modules, because the property module is of of the modules using Cython.
As the rest of the modules are found, I assue you set up the rest very well.

Mathieu Virbel

unread,
Apr 12, 2013, 5:01:34 AM4/12/13
to kivy-...@googlegroups.com
Hi,

Unlike the others files, properties is a python extension. Maybe the python in pydev is not able to load it. I don't know how pydev is working internally.
Maybe you can check the behavior with other python extension such as kivy.graphics.instructions etc.

Mathieu


--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Thomas Pietrowski

unread,
Apr 12, 2013, 5:55:49 AM4/12/13
to kivy-...@googlegroups.com
Well, I'm using PyDev all the time and it is working very well. It also shows class's and functions compiled into *.so's.
I just had to set up PyDev to use python of the Kivy bundle and add the kivy dir to the import dirs in it's settings. (Not using the howto mentioned above)
In Ubuntu I didn't need any additional modifications using our PPA.

Tyler Conrad

unread,
Apr 12, 2013, 10:33:38 AM4/12/13
to kivy-...@googlegroups.com
I have the same issue with eclipse on Ubuntu.  As a work around to get rid of the import error you can type:
#
for a comment then press ctrl-1 and select UnresolvedImport.  You end up with a comment on that line that makes eclipse ignore the error:
from kivy.properties import ObjectProperty # @UnresolvedImport

Thomas Pietrowski

unread,
Apr 12, 2013, 12:51:58 PM4/12/13
to kivy-...@googlegroups.com

Which kivy version are you using?

You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/fJ4KsAhS9zE/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.

Tyler Conrad

unread,
Apr 12, 2013, 1:32:08 PM4/12/13
to kivy-...@googlegroups.com
Looked into this and found the problem.  In Eclipse under Preferences/Pydev/Interpreter-Python/Libraries:
/usr/local/lib/python2.7/dist-packages
is included by the 'Auto Config' interpreter setup - so you'd expect eclipse to find the kivy source here.
But looks like you need to point eclipse at the 'kivy' sub-folder just have to add:
/usr/local/lib/python2.7/dist-packages/kivy
by clicking new folder for the included libraries.

I was only including the source from the local git clone - not the built package.

Kivy v1.6.1-dev

Thomas Pietrowski

unread,
Apr 12, 2013, 1:40:30 PM4/12/13
to kivy-...@googlegroups.com

In case you want to use the latest code you can also use our daily PPA, where Kivy is installed into /usr/lib, etc.

However, great to hear that you found a solution for it.

Tyler Conrad

unread,
Apr 12, 2013, 1:52:44 PM4/12/13
to kivy-...@googlegroups.com
I though that fixed it but turns out it was just taking a while for the parser to refresh...
I'll check out the PPA.
Thanks.
Message has been deleted

BobB

unread,
Apr 12, 2013, 8:36:05 PM4/12/13
to kivy-...@googlegroups.com
Further information but not a solution:

I have both Kivy 1.5.1 and 1.6.0 installed on a Windows 7 laptop.  Both were downloaded and installed following the Windows instructions in kivy.org.
Eclipse is the IDE employed with PyDev on top and with the tweaks as outlined in the www.ocularsoftware.com article.  I can switch between 1.5.1 and 1.6.0
pretty quickly by these actions:

Python file:  swap "kivy.require('1.5.1')" with "kivy.require('1.6.0')"
.kv file: swap "#:kivy1.5.1" with "#:kivy 1.6.0"
In Eclipse (as PyDev) follow Window | Preferences then click on PyDev and select "Interpreter -- Python": promote your chosen version to the top of the
interpreter heap which will also swap libraries and the environment.  Click Apply and make sure is works (click twice to maybe force an interpreter choice.)

Whether going from 1.5.1 to 1.6.0 or vice versa,  I can get the Unresolved import message on the Property line.  Restarting PyDev if in version 1.5.1 generally removes the error.  Restarting if in version 1.6.0 doesn't remove the error.  But, again, the error is bogus and the program executes nicely.
Maybe it's time to move on as if nothing is weird until 1.6.1... is available.



Prashant Patel

unread,
Sep 18, 2017, 11:43:56 PM9/18/17
to Kivy users support
Hi , I solved this by adding kivy.properities in forcebuiltin.
Go to option Eclips - preference -python interpreter- force builtin.
Reply all
Reply to author
Forward
0 new messages