<div dir="ltr">Hi Eric,<div><br></div><div style>That is consistent with what I uncovered. Last night I found the ccmake "advanced mode" option so I was able to update the PYTHON_INCLUDE_DIR and PYTHON_LIBRARY paths from system defaults to my custom locations (i.e. to my python include dir and my libpython*.a). </div>
<div style><br></div><div style>Everything built fine and I was able to import the vtk module without any errors. Of course I wish I could build the actual egg so that I can push it to my python site-packages and not have to deal with PYTHONPATH. I can work on that later though. For now, this is good progress.</div>
<div style><br></div><div style>Thank you,</div><div style>Tim</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 8, 2013 at 8:51 AM, Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu" target="_blank">emonson@cs.duke.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hey Tim,<div><br></div><div>I may not know enough to help you, but I ran across a problem recently on my Mac system where I have two versions of Python installed. CMake was picking up the correct Python executable, since that was in my PATH, but it was finding the "wrong" python library. In my case it was finding /usr/lib/libpython2.7.dylib which was installed on the system originally, instead of one associated with my self-installed python version.</div>
<div><br></div><div>Check all of those PYTHON_ variables in ccmake before you build to see whether they're all pointing to the versions you want.</div><div><br></div><div>-Eric</div><div><br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:12px;white-space:normal;font-family:Helvetica;word-spacing:0px"><div style="word-wrap:break-word">
<div>· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·</div><div>Eric E Monson</div><div>Duke Visualization Technology Group</div><div><br></div></div></span></span>
</div>
<br><div><div><div class="h5"><div>On Feb 7, 2013, at 6:10 PM, Timothy O'Keefe <<a href="mailto:timothy.okeefe@gmail.com" target="_blank">timothy.okeefe@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite">
<div><div class="h5"><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">I'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 'import vtk' 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'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'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></div></div>
_______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div></div></blockquote></div><br></div></div>