[vtkusers] vtkpython on mac os?

David E DeMarle dave.demarle at kitware.com
Thu Jan 28 12:22:12 EST 2016


@Tom

I haven't looked at it at all yet but I have a hunch.I am wondering if this
is an artifact of how, starting with El Captain, the system python is kind
of locked down by be Apple. If that is the case, switching to a third party
python (from fink, macports or homebrew) would solve it.

If not that, my next guess is that it is the library path management we do
in the packaging process to make redistributable binaries that causes the
problem. For windows and mac we do these things in different (platform
specific) ways which would explain why it can be done on linux and windows
but not mac.

In my personal use I either build vtk from source (most of my work) or run
from the bin directory (for intro to vtk courses). However I really would
like to get this nailed down. Likely then we can incorporate the binaries
into a wheel and make "pip install vtk" just work. Unfortunately it is
unknown when/if I'll find the time to investigate thoroughly (or solve it
once I do eh?).

FWIW - to build the binaries we use this superbuild:
https://gitlab.kitware.com/vtk/vtk-superbuild

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Wed, Jan 27, 2016 at 8:53 PM, Bernard Giroux <listes.bgiroux at gmail.com>
wrote:

> Hi,
>
> My results on el cap:
>
> I’ve got some home made modules, so I prefer to compile VTK myself.  I
> compile VTK after configuring this way (no mention about my modules here…)
>
> In a build directory:
>
> cmake -DCMAKE_BUILD_TYPE=Release \
> -DCMAKE_INSTALL_PREFIX=/usr/local/VTK-7.0.0.rc2 \
> -DVTK_WRAP_PYTHON=ON \
> -DCMAKE_MACOSX_RPATH=ON \
> -DCMAKE_INSTALL_NAME_DIR=/usr/local/VTK-7.0.0.rc2/lib /path/to/vtksource
>
> make
> sudo make install
>
> In /usr/local, I make a symbolic link pointing to the right directory:
>
> cd /usr/local
> sudo ln -s VTK-7.0.0.rc2 VTK
>
> Finally, in my $HOME/.bash_profile, I put
>
> export PYTHONPATH=/usr/local/VTK/lib/python2.7/site-packages
>
>
> FWIW, I run the macports version of python.
>
>
>
>
> > Le 27 janv. 2016 à 19:31, Tom Parker <tomparker at personaltelemetry.com>
> a écrit :
> >
> > To share my results, I never got this completely working on my mac El
> Capitan, but these environment variables work for me on W10, VTK 7 and VS
> 2015 Community Edition.
> >
> > VTK Python environment variables
> > C:\Python27\
> > C:\Python27\Scripts
> > C:\Software\VTK-7.0.0.rc2\bin\bin\Debug
> > C:\Software\VTK-7.0.0.rc2\bin\lib\Debug
> >
> > PYTHONPATH
> >
> > C:\Python27\lib
> > C:\Software\VTK-7.0.0.rc2\bin\bin\Debug
> > C:\Software\VTK-7.0.0.rc2\bin\lib\Debug
> > C:\Software\VTK-7.0.0.rc2\bin\Wrapping\Python
> > C:\Software\VTK-7.0.0.rc2\bin\Wrapping\Python\vtk
> >
> > Now I can run python.exe and successfully import vtk.
> >
> > And run all the python examples I’ve tested so far.
> >
> > Regards,
> > Tom
> >
> > From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Tom Parker
> > Sent: Tuesday, January 26, 2016 4:25 PM
> > To: Meehan, Bernard <MEEHANBT at nv.doe.gov>; vtkusers at vtk.org
> > Subject: Re: [vtkusers] vtkpython on mac os?
> >
> > Thank you! I’ll test it and let everyone know if it works for me.
> >
> > From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Meehan,
> Bernard
> > Sent: Tuesday, January 26, 2016 2:41 PM
> > To: vtkusers at vtk.org
> > Subject: Re: [vtkusers] vtkpython on mac os?
> >
> > This is what I am using in my ~./bash_profile, you may not need all of
> it, but it worked once and I just never changed it.
> >
> > export VTK=~/VTK
> > export PATH=$PATH:$VTK/bin
> > export PYTHONPATH=$PYTHONPATH:$VTK/lib/python2.7/site-packages
> > export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$VTK/lib
> >
> >
> > From:  vtkusers <vtkusers-bounces at vtk.org> on behalf of Tom Parker <
> tomparker at personaltelemetry.com>
> > Date:  Tuesday, January 26, 2016 at 12:18 PM
> > To:  "vtkusers at vtk.org" <vtkusers at vtk.org>
> > Subject:  [vtkusers] vtkpython on mac os?
> >
> >
> > Hello All,
> > I’ve download the latest vtkpython-7.0.0.rc2-Darwin-64bit.dmg to my mac
> with El Capitan and I’ve fought with it for hours.
> > I can run the examples successfully, but only from the
> /Applications/vtkpython/bin folder, if I try from any other folder I get
> the message “ImportError: No module named vtk”
> > After reading the docs, googling and reading the mailing lists I’ve
> tried every combination of PYTHONHOME, PYTHONPATH, LD_LIBRARY_PATH and
> DYLD_LIBRARY_PATH I can imagine with no joy.
> > I have gotten it working on my linux systems before so I can’t imagine
> what I’m doing wrong.
> > Can anyone share a set of working path and environment variables with me?
> > Thank you,
> > Tom
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Search the list archives at: http://markmail.org/search/?q=vtkusers
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtkusers
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160128/e8f529d0/attachment.html>


More information about the vtkusers mailing list