[vtkusers] install python wrapping on Mac 10.7

David Gobbi david.gobbi at gmail.com
Fri Oct 26 18:19:38 EDT 2012


I also see another potential problem.  It looks like you are trying to use the
python in "/opt/local/bin/python" instead of the one in "/usr/bin/python".

VTK works best with the python in /usr/bin, i.e. with the python that Apple
supplies with OS X.  If you try using VTK with a python from ActiveState
or MacPorts or Fink, then you will probably run into trouble.  It's best to
use these settings in CMake:

PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python
PYTHON_INCLUDE_DIR:PATH=/System/Library/Frameworks/Python.framework/Headers
PYTHON_LIBRARY:FILEPATH=/usr/lib/libpython2.7.dylib

 - David


On Fri, Oct 26, 2012 at 4:10 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> So it didn't work when you typed this before "make install"?
>
> export PYTHONPATH=/Users/sgu/softwares/lib/python2.7/site-packages/
>
>  - David
>
>
> On Fri, Oct 26, 2012 at 4:05 PM, Shiyuan <gshy2014 at gmail.com> wrote:
>> Hi David,
>>     Thanks for replying. I got a similar error. But I did set up the
>> PYTHONPATH env variable and export it. But for some reason, it doesn't see
>> it. This is the error I got, the  complete screen output for 'make install'
>> is also attached.
>> --------------------------------------------------
>> running cd "/Users/sgu/softwares/VTK/Wrapping/Python" &&
>> /opt/local/bin/python setup.py install --prefix="/Users/sgu/softwares"  2>&1
>> running install
>> Checking .pth file support in
>> /Users/sgu/softwares/lib/python2.7/site-packages/
>> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
>> -E -c pass
>> TEST FAILED: /Users/sgu/softwares/lib/python2.7/site-packages/ does NOT
>> support .pth files
>> error: bad install directory or PYTHONPATH
>>
>> You are attempting to install a package to a directory that is not
>> on PYTHONPATH and which Python does not read ".pth" files from.  The
>> installation directory you specified (via --install-dir, --prefix, or
>> the distutils default setting) was:
>>
>>     /Users/sgu/softwares/lib/python2.7/site-packages/
>>
>> and your PYTHONPATH environment variable currently contains:
>>
>>     ''
>>
>>
>> On Fri, Oct 26, 2012 at 4:33 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>>>
>>> Hi Shiyan,
>>>
>>> Did "make install" give an error, or did it just do nothing?  I have seen
>>> the
>>> following error on some systems:
>>>
>>>   "This directory does not currently exist.  Please create it and try
>>> again,
>>>   or choose a different installation directory (using the -d or
>>>   --install-dir option)."
>>>
>>> If you get the error that I quoted above, then setup.py is telling you
>>> that it
>>> needs you to specify a site-packages directory that already exists and is
>>> in the python path.
>>>
>>> If "make install" didn't give any error, then your problem is something
>>> else.
>>>
>>>  - David
>>>
>>>
>>> On Fri, Oct 26, 2012 at 2:01 PM, Shiyuan <gshy2014 at gmail.com> wrote:
>>> > Hi all,
>>> >        I tried to install vtk 5.8.0 on my mac 10.7 with Xcode 4.2. The
>>> > `cmake` and `make` is successful but make install doesn't copy the
>>> > python
>>> > module( eg. VTK/wrapping/Python/vtk/__init__.py) to the
>>> > $prefix-dir/lib/python2.7/site-packages.  The values I set are
>>> > cmake -DCMAKE_INSTALL_PREFIX=$prefix-dir -DBUILD_SHARED_LIB=ON
>>> > -DVTK_WRAP_PYTHON=ON.
>>> >
>>> > Any step did I miss? Thanks.
>>
>>



More information about the vtkusers mailing list