I am using Eclipse 3.1.1 with PyDev 1.0.8 to develop an application that uses VTK (The Visualization Toolkit - www.kitware.com). Previously, everything was working fine. I had to upgrade and recompile VTK to get access to some newer features and to use MangledMesa. I am now using VTK version 5.0. I also changed the location of VTK, but I updated my PYTHONPATH variables to reflect the change. Since the upgrade, I cannot run the project in Eclipse. If I run the program directly from the command line outside Eclipse, it works fine. Here is the error I get in Eclipse:
ImportError: libvtkCommonPythonD.so.5.0: cannot open shared object file: No such file or directory
I have set my system PYTHONPATH outside Eclipse to:
I have set the same directories in my PYTHONPATH in Eclipse both in the Project -> Properties menu and in the Window -> Preferences menu. In addition, I can see the file libvtkCommonPythonD.so.5.0 in both /usr/local/lib and /home/shari/vtk-bin/bin. (Could the problem be that the file is in both locations?)
Does anyone have any idea what I might have done wrong?
Actually, I use vtk 4.2 without problems, so, it appears some configuration problem...
The first thing I'd change is putting it only in the system or the project pythonpath... that should not be a problem, but as I didn't test it, there's no guarantee of it...
Another thing is that vtk needs some libraries not only in the PYTHONPATH, but also in the PATH, so, you should close Eclipse, check if those things are in the path and then restart eclipse (from a shell that has the path correct).
If that does not solve it, please report back.
Thanks. I did have one place I'd missed in my PATH, which I fixed. That doesn't seem to have solved the problem. However, I can run everything properly if I start Eclipse from the shell instead of from the menu, and I can live with that. Thanks! I still wonder why it doesn't work unless I start it from the shell. When I print sys.path from the program, it looks the same regardless of which way I started Eclipse.
I appreciate the help!
That happens because eclipse (actually, java itself) inherits the PATH from the shell where it runs. If you fix the PATH globally in your system, you should be able to start it from the menu.
-- I usually run it with a script that sets the path, as I find it too annoying the way that windows manages this in that hidden place in the control panel ;-)