[Insight-users] Python Wrappers - WinXP - Solved
Peter M. Bloomfield
peter.bloomfield at camhpet.ca
Thu Nov 1 10:30:20 EDT 2012
Hi,
I managde to get the python wrapping working in the end. I had to have the following on the PATH and PYTHONPATH environment
variables, where C:\CAMH\ITK is the install directory
PATH - added C:\CAMH\ITK\bin
PYTHONPATH - added C:\CAMH\ITK\lib\ITK-4.2\Python
I am not quite sure what the effect of adding C:\CAMH\ITK\bin to PATH is as there are only two files in the directory,
ITKCommon-4.2.dll and itkTestDriver.exe
The bottom line is that I can access itk from within python.
Peter
On Wednesday, October 31, 2012 10:37:25 AM Peter M. Bloomfield wrote:
Hi,
I am experiencing a problem with python wrapping. I have the following on a 32-bit WinXP machine
Visual Studio 9 2008
ITK V4.2.1
Python 2.7.2
I have selected 'ITK_WRAP_PYTHON' and 'BUILD_SHARED_LIBS' and set 'CMAKE_INSTALL_PREFIX' to C:\CAMH\ITK within cmake, and all
compiles and installs without error in VS 2008.
I have set a PYTHONPATH to include both
C:\CAMH\ITK\lib\ITK-4.2\Python
C:\CAMH\ITK\lib
though I am not sure if I have these correct. I can import itk from within python, but get an error when issuing the command
image_type = itk.Image[itk.F, 3]
as shown below.
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Peter>python
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import itk
>>> image_type = itk.Image[itk.F, 3]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkLazy.py", line 37, in __getattribute__
itkBase.LoadModule(module, namespace)
File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkBase.py", line 95, in LoadModule
LoadModule(dep, namespace)
File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkBase.py", line 95, in LoadModule
LoadModule(dep, namespace)
File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkBase.py", line 95, in LoadModule
LoadModule(dep, namespace)
File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkBase.py", line 95, in LoadModule
LoadModule(dep, namespace)
File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkBase.py", line 103, in LoadModule
if not swigModuleName in sys.modules: module = loader.load(swigModuleName)
File "C:\CAMH\ITK\lib\ITK-4.2\Python\itkBase.py", line 214, in load
return imp.load_module(name, fp, pathname, description)
File "C:\CAMH\ITK\lib\ITK-4.2\Python\ITKCommonPython.py", line 30, in <module>
_ITKCommonPython = swig_import_helper()
File "C:\CAMH\ITK\lib\ITK-4.2\Python\ITKCommonPython.py", line 26, in swig_import_helper
_mod = imp.load_module('_ITKCommonPython', fp, pathname, description)
ImportError: DLL load failed: The specified module could not be found.
>>>
Can anyone point me in the right direction to get the itk python wrapping working,
Many thanks
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20121101/ff2ace66/attachment.htm>
More information about the Insight-users
mailing list