[vtk-developers] setuptools prevents installation of VTK python wrappers

Cyrus Harrison cyrush at llnl.gov
Thu Nov 10 15:02:28 EST 2011


Hi Everyone,

I noticed that when setuptools (easy_install) python module is installed 
- the VTK build fails to install the VTK python wrappers.
I tested this morning with latest git version of the VTK source code on 
linux and I also have encountered this on OSX.

Details (my cmake configure line & the error message that I see during 
'make install') are included at the end of this email.

Sadly, it appears that setuptools is being overly strict about 
PYTHONPATH, ".pth" files, and default sys.path entries.

My question:

Is explicit setuptools support really necessary?

Looking at VTK/Wrapping/Python/setup.py.in, there is a single option 
conditional on setuptools:

     # If setup_tools is available, then add an extra option to disable
     # creation of a ZIP file.
     if has_setup_tools:
         opts['zip_safe'] = 0

This option just prevents setuptools from zipping everything into a 
single file, using python's default 'distutils' this is a non issue.

Note, there is an expired ticket that identifies this same behavior:
http://www.vtk.org/Bug/view.php?id=7501
It does not explicitly identify setuptools, but '.pth' error message & 
'/test-easy-install-30864.pth' point to setuptools.


Any thoughts on just simply using 'distutils'?

Thanks,
-Cyrus Harrison

Details:

cmake configure:
(I am doing an out of source build, but I encountered the same problem 
with an in source build)

----
cmake \
     
-DCMAKE_INSTALL_PREFIX:PATH=/home/user/hdrive/dev/vtk-integration/vtk.install/ 
\
     -DVTK_INSTALL_INCLUDE_DIR:PATH=/include/ \
     -DVTK_INSTALL_LIB_DIR:PATH=/lib/ \
     -DBUILD_SHARED_LIBS:BOOL=ON \
     -DVTK_WRAP_PYTHON:BOOL=ON \
     
-DPYTHON_EXECUTABLE:FILEPATH=/home/user/hdrive/dev/libs/2.4.0/python/2.6.4/linux-i686_gcc-4.1/bin/python 
\
     
-DPYTHON_INCLUDE_DIR:PATH=/home/user/hdrive/dev/libs/2.4.0/python/2.6.4/linux-i686_gcc-4.1/include/python2.6/ 
\
     
-DPYTHON_LIBRARY:FILEPATH=/home/user/hdrive/dev/libs/2.4.0/python/2.6.4/linux-i686_gcc-4.1/lib/libpython2.6.so 
\
     -DPYTHON_EXTRA_LIBS:STRING="-lpthread -ldl -lutil -lm" \
     ../VTK
----


'make install' error:

----
running cd 
"/home/user/hdrive/dev/vtk-integration/vtk.build/Wrapping/Python" && 
/home/user/hdrive/dev/libs/2.4.0/python/2.6.4/linux-i686_gcc-4.1/bin/python 
setup.py install 
--prefix="/home/user/hdrive/dev/vtk-integration/vtk.install"  2>&1
running install
Checking .pth file support in 
/home/user/hdrive/dev/vtk-integration/vtk.install/lib/python2.6/site-packages/
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

     [Errno 2] No such file or directory: 
'/home/user/hdrive/dev/vtk-integration/vtk.install/lib/python2.6/site-packages/test-easy-install-7410.pth'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

     
/home/user/hdrive/dev/vtk-integration/vtk.install/lib/python2.6/site-packages/

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).
----

This error message is printed, but the 'make install' return code does 
not change to indicate an error with running setup.py.





More information about the vtk-developers mailing list