[vtkusers] Problem between vtk-python4.4 and python 2.4

Yoan BLANC greut.lists at dosimple.ch
Fri Nov 4 04:50:01 EST 2005


philopensource at hotmail.com wrote:

> Hi list,
> I'm on windows XP with python 2.4.
> I tryied to install and use vtk-python4.4 available on the site of 
> mayavi.
>
> There is a conflict between python library on my system and the one 
> which were used to build vtk-python 2.4.
>
>  File "C:\Documents and 
> Settings\philippe\Bureau\workspace\pyvisu\pyvilib\visus\vtkPylab.py", 
> line 5, in ?
>    import vtk
>  File "C:\Python24\lib\site-packages\vtk_python\vtk\__init__.py", line 
> 27, in ?
>    from common import *
>  File "C:\Python24\lib\site-packages\vtk_python\vtk\common.py", line 
> 9, in ?
>    from vtkCommonPython import *
> ImportError: Module use of python23.dll conflicts with this version of 
> Python.

You've to patch CMake :

--- FindPythonLibs.cmake.old	2005-10-14 16:16:43.765625000 +0200
+++ FindPythonLibs.cmake	2005-10-14 15:44:41.609375000 +0200
@@ -12,8 +12,10 @@
 
 IF(WIN32)
   FIND_LIBRARY(PYTHON_DEBUG_LIBRARY
-    NAMES python23_d python22_d python21_d python20_d python
+    NAMES python24_d python23_d python22_d python21_d python20_d python
     PATHS
+	[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]/libs/Debug
+	[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]/libs
     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/libs/Debug
     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/libs
     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]/libs/Debug
@@ -30,7 +32,8 @@
 ENDIF(WIN32)
 
 FIND_LIBRARY(PYTHON_LIBRARY
-  NAMES python23 python2.3 python2.3.dll
+  NAMES python24 python2.4 python2.4.dll 
+        python23 python2.3 python2.3.dll
         python22 python2.2 python2.2.dll
         python21 python2.1 python2.1.dll
         python20 python2.0 python2.0.dll
@@ -45,6 +48,7 @@
   /usr/lib/python1.5/config
   /usr/lib
   /usr/local/lib
+  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]/libs
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/libs
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]/libs
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/libs
@@ -58,7 +62,7 @@
 SET(PYTHON_FRAMEWORK_INCLUDES)
 IF(Python_FRAMEWORKS)
   IF(NOT PYTHON_INCLUDE_PATH)
-    FOREACH(version 2.3 2.2 2.1 2.0 1.6 1.5)
+    FOREACH(version 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
       FOREACH(dir ${Python_FRAMEWORKS})
         SET(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES}
           ${dir}/Versions/${version}/include/python${version})
@@ -77,6 +81,7 @@
   /usr/include/python1.5
   /usr/include
   /usr/local/include
+  [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]/include
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/include
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]/include
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/include


>
> How can i build a vtk-python available on python 2.4?
>
> I have cygwin installed on my computer.
> Thanks a lot for the answer,
> Philippe Collet





More information about the vtkusers mailing list