<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">I&#39;m having difficulty installing and using the python VTK bindings.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">

My goal is to use VTK with my own version of python (2.7.3), one that I maintain alongside the system-provided version (which is much older). This is on a CentOS 5 platform.</div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">I downloaded VTK 5.10.1, unpacked it, created a build directory, and ran the usual ccmake, make, make install pipeline. I enabled the BUILD_SHARED_LIBS, VTK_WRAP_PYTHON, and VTK_WRAP_TCL options. The configuration went fine. During the make stage, everything went fine except towards the end when the build system tries to compile the python bindings and/or tries to build the python egg. For whatever reason, the build system really wanted me to install these into:</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">$VTK_INSTALL_PREFIX/lib/python2.7/site-packages<br></div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">which is fine. The directory did not originally exist, so I created it, re-ran make and everything was fine. I placed the directory on my PYTHONPATH as well. Once the build completed, I tried to &#39;import vtk&#39; in my python interpreter and received the following error:</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">ImportError: libvtkCommonPythonD.so.5.10: cannot open shared object file: No such file or directory </div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">So I added the following location to my LD_LIBRARY_PATH:</div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">$INSTALL_PREFIX/lib/vtk-5.10<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">

which resolved the error. Unfortunately, I received a new error:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>ImportError: $INSTALL_PREFIX/lib/vtk-5.10/libvtkPythonCore.so.5.10: undefined symbol: _PyUnicodeUCS4_AsDefaultEncodedString</div>

<div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px">which to my understanding will occur when the library is compiled against a version of python that uses 4 byte wide unicode characters and then you try to import the module within a version of python that uses 2 byte wide unicode characters. I don&#39;t know how this could happen at the moment, so I could use a suggestion.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I&#39;m trying to figure out how I could have managed to build VTK against a different version of python than the one I have on my PATH. If anyone can help out as I continue to hammer away at this issue, that would be extremely helpful.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks,</div><div style="font-family:arial,sans-serif;font-size:13px">Tim<br></div><div></div>
</div>