I installed the Python bindings of VTK 5.1 correctly. In Python, import vtk worked, but import itk did not work yet. So I wanted to install the Python bindings of ITK 4.2.I needed to install SWIG 2.0.7, and from the error message which arose during ./configure in the SWIG source directory, I understood I needed to install pcre. So I chose the version 8.31 of pcre. Here is a summary of the process:(VTK + Python) ---> This works.(ITK + Python) ---> SWIG needed ---> pcre neededNow that pcre is installed, my problem is yum has stopped working:[root@wok build]# yumThere was a problem importing one of the Python modulesrequired to run yum. The error leading to this problem was:   libvtkIOPythonD.so.5.10: cannot open shared object file: No such file or directoryPlease install a package which provides this module, orverify that the module is installed correctly.It's possible that the above module doesn't match thecurrent version of Python, which is:2.7 (r27:82500, Sep 16 2010, 18:02:00) [GCC 4.5.1 20100907 (Red Hat 4.5.1-3)]If you cannot solve this problem yourself, please go to the yum faq at:  http://yum.baseurl.org/wiki/FaqI wonder if I should add variables to the PATH.Maybe it is related to a problem I had with SWIG: it worked as a user but not as root.wok ~ $ swig -swiglib/usr/local/share/swig/2.0.7[root@wok home]# swig -swiglibswig: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directoryI had to add one line to .bashrc of the root user to make swig work with both the user and the root:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/There could be something with the Python path.In Python, I noticed I could import vtk as a user, but not as root.wok ~ $ pythonPython 2.7 (r27:82500, Sep 16 2010, 18:02:00) [GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2Type help, copyright, credits or license for more information.>>> import vtk>>> but:[root@wok ~]# pythonPython 2.7 (r27:82500, Sep 16 2010, 18:02:00) [GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2Type help, copyright, credits or license for more information.>>> import vtkTraceback (most recent call last):  File <stdin>, line 1, in <module>  File /user/wok/home/Softwares/VTK_5.1/build/Wrapping/Python/vtk/__init__.py, line 41, in <module>    from vtkCommonPython import *ImportError: libvtkCommonPythonD.so.5.10: cannot open shared object file: No such file or directoryPCRE seems to me to be installed correctly:[root@wok build]# pcretest -CPCRE version 8.31 2012-07-06Compiled with  8-bit support only  No UTF-8 support  No Unicode properties support  No just-in-time compiler support  Newline sequence is LF  \R matches all Unicode newlines  Internal link size = 2  POSIX malloc threshold = 10  Default match limit = 10000000  Default recursion depth limit = 10000000  Match recursion uses stackand[root@wok build]# locate libpcre/lib64/libpcre.so.0/lib64/libpcre.so.0.0.1/usr/lib64/libpcrecpp.so.0/usr/lib64/libpcrecpp.so.0.0.0/usr/lib64/libpcreposix.so.0/usr/lib64/libpcreposix.so.0.0.0
There was a problem importing one of the Python modules required to run yum
fedora;yum
The problem was related to the PYTHONPATH. It could be solved by removing one line from .bashrc out of four I had copied from a tutorial:export PYTHONPATH=$PYTHONPATH:~/Softwares/VTK_5.1/build/Wrapping/Python/vtk/I kept the three following lines:export PYTHONPATH=$PYTHONPATH:~/Softwares/VTK_5.1/build/Wrapping/Python/export PYTHONPATH=$PYTHONPATH:~/Softwares/VTK_5.1/build/bin/export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/Softwares/VTK_5.1/build/bin/Now, I can import vtk as a user, and still use yum as root. I cannot import vtk as root, but I never wanted to anyway.In order to solve the problem, I first removed the .bashrc file and noticed it fixed yum. Then I proceeded to add the lines above to the PYTHONPATH to gain access to import vtk. Finally, I noticed ipython would not work when import vtk would work, and reciprocally.