Saturday, June 21, 2008

Configuring tvtk / forced builtins

Recently, there was a report on problems while configuring tvtk (it's a pythonic API over vtk).

Having the import:

from enthought.tvtk.api import tvtk


did not bring any completions while later using 'tvtk.' on that module.

This happens because the code in tvtk does some black-magic to load the classes in that module... there's a module called enthought.tvtk.tvtk that has a class tvtk that's actually what's imported in "from enthought.tvtk.api import tvtk", so, the solution is adding "enthought.tvtk.tvtk.tvtk" to the "forced builtins", so that pydev can understand that it should be dynamically analyzed.

More info on the "forced builtins" can be found at: http://www.fabioz.com/pydev/manual_101_interpreter.html... and yes: finding out what should be dynamically analyzed and what shouldn't can be very tricky some times...

4 comments:

Unknown said...

I can't open bug report page(in china).
Current version(1.3.18) runs on eclipse 3.4 can't rename/move any project files(not only .py files).
I first install subversion plugin, i can rename file, then i install pydev 1.3.18,
can't reanme files.

Fabio Zadrozny said...

I'll try to take a look at it, but one thing I know is that pydev is not totally friendly with eclipse 3.4 (some API incompatibilities have been fixed for 1.3.19, but it's still not thoroughly tested)

Ryan said...

I have the same rename problem. I'm wondering if renaming it on the filesystem is going to screw things up?

Fabio Zadrozny said...

I guess that renaming in the filesystem wouldn't screw it, but I guess that using the "resource navigator" view instead of the "pydev package explorer" would be a better solution (until this compatibility issue is solved to correctly handle eclipse 3.4).