<div dir="ltr">Hi Ashwin,<div><br></div><div>The PYTHON_LIBRARY_PATH needs to point to a library, rather than a directory.  For example,</div><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">-DPYTHON_LIBRARY_PATH=</span>/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/<a href="http://libpython3.5m.so">libpython3.5m.so</a></div><div><br></div><div>Or possibly</div><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">-DPYTHON_LIBRARY_PATH=</span>/usr/lib64/<a href="http://libpython3.5m.so">libpython3.5m.so</a><br></div><div><br></div><div>The location will vary between linux distros.</div><div><br></div><div> - David</div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 11, 2018 at 7:15 PM, ashwin .D <span dir="ltr"><<a href="mailto:winash12@gmail.com" target="_blank">winash12@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>It seems I was a bit premature in jumping to the conclusion that my VTK installation was complete :-). Yes I did generate a vtkpython.exe but that was with the 2.7.0 installation. When I did run this with Python3.5 I got an error. <br><br></div>So I went back to the build process specifically cmake and these are the errors I got when I typed make -j8 <br><br><br></div>This is my cmake command - <pre><code>cmake ../ -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release -DVTK_WRAP_PYTHON=ON -DVTK_PYTHON_VERSION=3.5 -DPYTHON_EXECUTABLE=/usr/bin/<wbr>python3.5 -DPYTHON_INCLUDE_DIR=/usr/<wbr>include/python3.5 -DPYTHON_LIBRARY_PATH=/usr/<wbr>lib/python3.5
</code></pre><br><br></div>I presume VTK can be compiled with Python 3.5 or not ? I am not sure. Apologies for the earlier over sight. This is on Ubuntu 16.04. <br><div><div><br><br><pre><code>vtkPythonAppInit.cxx:(.text+<wbr>0x97): undefined reference to `PyList_Insert'
CMakeFiles/vtkpython.dir/<wbr>vtkPythonAppInit.cxx.o: In function `     

vtkPythonAppInitPrependPythonP<wbr>ath(char const*) [clone .constprop.33]':
vtkPythonAppInit.cxx:(.text+<wbr>0x322): undefined reference to `PySys_GetObject'
vtkPythonAppInit.cxx:(.text+<wbr>0x32f): undefined reference to `PyUnicode_FromString'
vtkPythonAppInit.cxx:(.text+<wbr>0x33f): undefined reference to `PyList_Insert'
CMakeFiles/vtkpython.dir/<wbr>vtkPythonAppInit.cxx.o: In function `main':
vtkPythonAppInit.cxx:(.text.<wbr>startup+0xf9): undefined reference to `Py_DecodeLocale'
vtkPythonAppInit.cxx:(.text.<wbr>startup+0x10f): undefined reference to `Py_SetProgramName'
vtkPythonAppInit.cxx:(.text.<wbr>startup+0x114): undefined reference to `Py_Initialize'
vtkPythonAppInit.cxx:(.text.<wbr>startup+0x119): undefined reference to `PyEval_InitThreads'
vtkPythonAppInit.cxx:(.text.<wbr>startup+0x14d): undefined reference to `PySys_GetObject'
vtkPythonAppInit.cxx:(.text.<wbr>startup+0x155): undefined reference to ` PyUnicode_EncodeFSDefault'
vtkPythonAppInit.cxx:(.text.<wbr>startup+0x162): undefined reference to `PyBytes_AsString'
vtkPythonAppInit.cxx:(.text.<wbr>startup+0x471): undefined reference to `Py_DecodeLocale'
vtkPythonAppInit.cxx:(.text.<wbr>startup+0x4ad): undefined reference to `PyMem_Free'
vtkPythonAppInit.cxx:(.text.<wbr>startup+0x4bf): undefined reference to `PyMem_Free'
vtkPythonAppInit.cxx:(.text.<wbr>startup+0xc92): undefined reference to `Py_Main'
vtkPythonAppInit.cxx:(.text.<wbr>startup+0xc9e): undefined reference to `PyMem_Free'
vtkPythonAppInit.cxx:(.text.<wbr>startup+0xcc4): undefined reference to `PyMem_Free'
collect2: error: ld returned 1 exit status
Wrapping/Python/CMakeFiles/<wbr>vtkpython.dir/build.make:98: recipe for target   'bin/vtkpython' failed
make[2]: *** [bin/vtkpython] Error 1
CMakeFiles/Makefile2:25907: recipe for target 'Wrapping/Python/CMakeFiles/<wbr>vtkpython.dir/all' failed
make[1]: *** [Wrapping/Python/CMakeFiles/<wbr>vtkpython.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  9%] Built target vtkNetCDF
[ 30%] Built target VTKData
[ 31%] Built target vtkCommonCoreCxxTests
[ 32%] Built target vtkCommonDataModel
[ 35%] Built target vtkCommonCorePythonD
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2</code></pre><br></div></div></div><div class="gmail-HOEnZb"><div class="gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 11, 2018 at 8:54 AM, ashwin .D <span dir="ltr"><<a href="mailto:winash12@gmail.com" target="_blank">winash12@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I was able to get this to compile successfully and generate a vtkpython.exe. I downloaded a later version of this namely i.e. 8.1. 0 and I also needed to add one more option to the command line <br><br></div>i.e. -DVTK_PYTHON_VERSION=3.5 while running cmake. This I believe is *required* else it defaults to the 2.7 installation. <br><br><br></div><div class="gmail-m_5948973699020524391HOEnZb"><div class="gmail-m_5948973699020524391h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 8, 2018 at 8:02 PM, ashwin .D <span dir="ltr"><<a href="mailto:winash12@gmail.com" target="_blank">winash12@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">The log file I sent you just now is the result of running make -j8. <br></div><div class="gmail-m_5948973699020524391m_-5495975984556795101HOEnZb"><div class="gmail-m_5948973699020524391m_-5495975984556795101h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 8, 2018 at 7:58 PM, David E DeMarle <span dir="ltr"><<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Did you run make?<div>cmake just builds makefiles/visual studio solution files or whatever. You still have to compile those to make the library/binraries/bindings and whatnot.</div></div><div class="gmail_extra"><span class="gmail-m_5948973699020524391m_-5495975984556795101m_7964320937561822490HOEnZb"><font color="#888888"><br clear="all"><div><div class="gmail-m_5948973699020524391m_-5495975984556795101m_7964320937561822490m_-7549620442342686876gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>David E DeMarle<br>Kitware, Inc.<br>Principal Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: <a href="tel:(518)%20881-4909" value="+15188814909" target="_blank">518-881-4909</a></div></div></div></div></div></div>
<br></font></span><div class="gmail_quote"><span>On Thu, Mar 8, 2018 at 6:45 AM, ashwin .D <span dir="ltr"><<a href="mailto:winash12@gmail.com" target="_blank">winash12@gmail.com</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="gmail-m_5948973699020524391m_-5495975984556795101m_7964320937561822490h5"><div dir="ltr"><div><div><div><div><div><div><div><div>Hello,<br></div>           I have VTK 7.0.0 tar file and I am trying to compile from source the python wrapper for VTK. I have ccmake installed on my Ubuntu 16.04 box but no matter what I try(the installation itself proceeds with no errors) but I cannot find out where the python wrapper for SDK is present. When I type<br><br></div>python3.5  import vtk <br><br></div>I get ImportError : no module named 'vtk`<br><br></div>Here is how I built VTK for python using ccmake<br><br><br>ccmake -DCMAKE_INSTALL_PREFIX=/opt/lo<wbr>cal/vtk7.0-py3.5.0 -DBUILD_SHARED_LIBS:BOOL=ON-DV<wbr>TK_WRAP_PYTHON:BOOL=ON -DVTK_PYTHON_VERSION:STRING=3.<wbr>5 -DPYTHON_EXECUTABLE:PATH=/usr/<wbr>bin/python3.5 -DPYTHON_INCLUDE_DIR=/usr/incl<wbr>ude/python3.5 -DPYTHON_LIBRARY:PATH=/usr/loc<wbr>al/lib/python3.5/ ..VTK-7.0.0<br><br></div>Then a ccmake window pops up and I type ctcl - c twice and ctrl-g once. But this does not do the job. <br><br></div>Any suggestions will be appreciated. I intend to use VTK with Mayavi eventually. <br><br></div>Best regards,<br></div>Ashwin. <br></div>
</div></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></div></div></blockquote></div><br></div></div></div>