[vtkusers] Fwd: import vtk in python gives dll load failure

Hon Fai Choi honfai.choi at gmail.com
Fri Nov 4 14:38:36 EDT 2011


Hi,

Thank you for the suggestion. I used dependency walker and apparently there
was a problem with the MATLAB mex. The libmx.dll couldn't be found because
it was not in the path and also msvcr80.dll was required. For some reason,
certain C++ classes in Qt could not be located as well, amongst which were
QMapData,QVectorData and QPainter. This seems to be related to an issue
which has already been posted (
http://www.cmake.org/pipermail/paraview/2010-March/016338.html   ,
http://www.vtk.org/pipermail/vtkusers/2010-June/109514.html).

I have recompiled vtk with the VTK_USE_MATLAB_MEX option turned off and now
I could import vtk in python. However I get an error when I try to create a
vtkQtListView() object :

QWidget: Must construct a QApplication before a QPaintDevice

A related issue has been posted in the FAQ (http://www.vtk.org/Wiki/VTK/FAQ),
but from what I understood, this should only be a problem when you use vtk
in debug while the release version is in your path. However, I only have
installed the release-version of vtk, but I still get this error. Any idea
where this error comes from and how I can fix it?

thanks,
Hon Fai



On Thu, Nov 3, 2011 at 3:08 PM, Brooke Steele <bnsteel at gmail.com> wrote:

> if the module it is trying to load seems to exist (i.e. whichever one
> contains vtkGraphicsPython), use the dependency walker to make sure there
> is not a mismatch in machine type (32 vs 64) between any dlls that are
> loaded by the one that cannot be found
>
>
> On Thu, Nov 3, 2011 at 2:37 PM, Hon Fai Choi <honfai.choi at gmail.com>wrote:
>
>> Hi,
>>
>> I am trying to build vtk 5.8.0 against Qt 4.7.4 with wrappings for python
>> 2.7.2 on a windows XP system. I use MSVC 2010 as the native compiler.
>> I have build the MSVC vtk-solution in Release mode and updated the PATH
>> and PYTHONPATH environment variables. I have installed the build in the
>> following directory (by building the INSTALL project):
>>
>> "C:\SciComp\vtk-5.8.0\vtk-5.8.0-msvc2010" ,
>>
>> so I have added "C:\SciComp\vtk-5.8.0\vtk-5.8.0-msvc2010\bin" to PATH and
>> PYTHONPATH and also added
>> "C:\SciComp\vtk-5.8.0\vtk-5.8.0-msvc2010\lib\site-packages" to PYTHONPATH.
>>
>> The build did not give any errors, but when I try to import vtk in python
>> I get the following error message:
>>
>> "Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>>   File
>> "C:\SciComp\vtk-5.8.0\vtk-5.8.0-msvc2010\lib\site-packages\vtk-5.8.0-py2.7.egg\vtk\__init__.py",
>> line 45, in <module>
>>     from vtkGraphicsPython import *
>>  ImportError: DLL load failed: The specified module could not be found."
>>
>> It seems that python cannot find the Graphics module. Does anyone know
>> what I am doing wrong here? I have put the CMakeCache file in the
>> attachment.
>>
>>
>> thanks,
>> Hon Fai
>>
>>
>>
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111104/503a29f0/attachment.htm>


More information about the vtkusers mailing list