Installing VMTK directly into a Python Distro, e.g., Enthought's EPD

587 views
Skip to first unread message

Adamos Kyriakou

unread,
Oct 14, 2013, 6:07:02 AM10/14/13
to vmtk-...@googlegroups.com
Hi all,

I'm trying to install VMTK directly into an existing Python distribution, namely Enthought's EPD. I've installed VMTK's latest stable Win7 x64 release on my machine and I've been trying to make it work on my EPD distro (EPD v7.3-2 with Python v2.7.3 and VTK v5.6.0). Now VTK imports fine of course and I set the 'PATH' environment variable according to the post 'using vmtk on windows7' i.e.

PATH
  C:\Program Files\vmtk\Install\bin;
  C:\Program Files\vmtk\Install\lib;
  C:\Program Files\vmtk\Install\lib\vtk-5.8;
  C:\Program Files\vmtk\Install\lib\vmtk;
PYTHONPATH
  C:\Program Files\vmtk\Install\lib\vmtk;
  C:\Program Files\vmtk\Install\bin\Python;

However when I'm trying:

>> from vmtk import vtkvmtk

I get a 'no module named vmtk' error. Am I missing something?

Thanks a lot!
Adam

Luca Antiga

unread,
Oct 20, 2013, 10:28:44 AM10/20/13
to vmtk-...@googlegroups.com
Hi Adamos,
 sorry for the late reply. 
I must say I have no experience with the EPD distribution. The binary vmtk installer has been created by linking to a specific version of Python and VTK, the latter built with the native Python wrappers, and I'm not sure this is the same version and mechanism used in EPD.
Can you please post (verbatim) the result of 

from vmtk import pypes
from vmtk import vmtkscripts
from vmtk import vtkvmtk

I hope I can get some more information from the error messages.

Luca


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



--
Luca Antiga, PhD
Co-founder and Principal Scientist, OROBIX Srl
via L.A. Muratori 3, 24123 Bergamo, Italy

web: www.orobix.com
mobile: +39.347.43.16.596
twitter: @lantiga

"This message originates from OROBIX Srl and its contents and attachments are privileged and confidential and are intended only for the individual(s) or entity(ies) named above. This message should not be forwarded, distributed or disclosed. Any unauthorized use, dissemination and duplication is strictly prohibited and may be unlawful. All personal messages express views solely of the sender, which are not to be attributed to OROBIX Srl, and may not be copied or distributed without this disclaimer. If you are not the intended recipient or received this message in error, please delete this message and notify the sender by reply e-mail. Opinions, conclusions and other information in this message that do not relate to the official business of OROBIX Srl shall be understood as neither given nor endorsed by it."

Adamos Kyriakou

unread,
Oct 21, 2013, 2:47:14 AM10/21/13
to vmtk-...@googlegroups.com
Hi Luca,

thanks a lot for getting back to me, the EPD isn't really any different than any other distro, it just bundles everything together so you don't have to go around pipping packages or building them. When I use the %env magic in iPython I get (a huge print but here are the paths):

'PATH': 'C:\\Users\\adam\\AppData\\Local\\Enthought\\Canopy\\User\\Scripts;C:\\Users\\adam\\AppData\\Local\\Programs\\LLNL\\VisIt 2.6.2;C:\\Python27;C:\\Python27\\Scripts; C:\\Program Files\\vmtk\\Install\\bin; C:\\Program Files\\vmtk\\Install\\lib\\vmtk; C:\\Program Files\\vmtk\\Install\\lib\\vtk-5.8; '
'PYTHONPATH': 'C:\\Program Files\\vmtk\\Install\\bin; C:\\Program Files\\vmtk\\Install\\lib\\vmtk; C:\\Program Files\\vmtk\\Install\\lib\\vtk-5.8;'

So in the same session I've tried 

from vmtk import pypes
from vmtk import vmtkscripts
from vmtk import vtkvmtk

And I get

from vmtk import pypes
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
C:\Windows\<ipython-input-1-78716b740622> in <module>()
----> 1 from vmtk import pypes
ImportError: No module named vmtk
from vmtk import vmtkscripts
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
C:\Windows\<ipython-input-4-da5e9b60aba0> in <module>()
----> 1 from vmtk import vmtkscripts
ImportError: No module named vmtk
from vmtk import vtkvmtk
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
C:\Windows\<ipython-input-5-6273140635ec> in <module>()
----> 1 from vmtk import vtkvmtk
ImportError: No module named vmtk
 
So really I'm not sure what I'm missing here. Any ideas?

Thanks a whole bunch!
Adam
 

Luca Antiga

unread,
Oct 28, 2013, 5:05:00 PM10/28/13
to vmtk-...@googlegroups.com
Hi Adam,
 I did some experimenting (I'm slowed down by the arrival of a new kid, thanks for your patience). 

I'm attaching a file that you should run with your interpreter. It modifies the environment variables on the fly and tries to import vmtk. Please change the vmtkhome variable to reflect the location where vmtk is currently installed on your system.

You should run it with
python.exe env_vars.py
If the script succeeds, you'll see a list of vmtk class names and the line No errors, success. Otherwise you'll see an error.

In any case, please let me know!

Best,

Luca
twitter: @lantiga
mobile: +39.347.43.16.596
env_vars.py

Adamos Kyriakou

unread,
Oct 29, 2013, 4:22:24 AM10/29/13
to vmtk-...@googlegroups.com
Hi Luca,

thanks a lot for your reply and congrats!
I ran your script (after obviously changing the 'home' path) but I'm getting an error being:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
C:\Python27\lib\site-packages\IPython\utils\py3compat.pyc in execfile(fname, glob, loc)
    166             else:
    167                 filename = fname
--> 168             exec compile(scripttext, filename, 'exec') in glob, loc
    169     else:
    170         def execfile(fname, *where):
C:\Users\adam\Desktop\env_vars.py in <module>()
     12 import vmtk
     13 from vmtk import pypes
---> 14 from vmtk import vtkvmtk
     15 
     16 print dir(vtkvmtk)
C:\Program Files\VMTK\Install\lib\vmtk\vmtk\vtkvmtk.py in <module>()
     15     from libvtkvmtkITKPython import *
     16 else:
---> 17     from vtkvmtkCommonPython import *
     18     from vtkvmtkComputationalGeometryPython import *
     19     from vtkvmtkDifferentialGeometryPython import *
ImportError: DLL load failed: The specified procedure could not be found.

Now I find this really, really weird but perhaps you have an explanation. Also FYI I tried installing vmtk within Slicer and even though the name's listed the package does not exist. Has support ceased?

Best,
Adam

Luca Antiga

unread,
Oct 29, 2013, 5:31:56 PM10/29/13
to vmtk-...@googlegroups.com
Hi Adamos,
 it looks like the interpreter failed to load the vtkvmtkCommonPython dll. This could happen for a number of reasons, for instance the Python interpreter is 32 bit while vmtk is 64 bit so the architectures don't match, or vmtk has been linked against one version of VTK but your interpreter sees another version.
Can you verify?

Luca

Luca Antiga

unread,
Oct 29, 2013, 5:32:51 PM10/29/13
to vmtk-...@googlegroups.com
Hi Adamos,
 regarding Slicer, I know a lot of progress was done on vmtk in Slicer4, but I have to update on the status of the module.
If something comes up I'll let you know.
Best,

Luca

Adamos Kyriakou

unread,
Oct 30, 2013, 4:28:04 AM10/30/13
to vmtk-...@googlegroups.com
Hi Luca,

thanks again for your response and for taking time to sort this out, really appreciate it :)
I can verify that both architectures are x64 but it does seem that the interpreter sees its own VTK version (v5.6.0) and does not necessarily load the one vmtk is linked against. Is there a way to resolve this? Can I link vmtk to whatever VTK I want without building it from source (you know how these things suck on Windows)?

Best,
Adam

Luca Antiga

unread,
Oct 30, 2013, 4:59:10 AM10/30/13
to vmtk-...@googlegroups.com
Hi Adamos,
 unfortunately you either prevent the interpreter to find its own VTK 5.6 or you have to build from source. I know, it's 2013 but it's more or less the same thing on all platforms.

Luca
Reply all
Reply to author
Forward
0 new messages