[vtk-developers] python install prefix in setup.py

David Gobbi dgobbi at atamai.com
Thu Feb 2 12:00:25 EST 2006


Prabhu Ramachandran wrote:

>Right, /usr/local/lib/python2.x/site-packages under Debian is the
>canonical place for non-deb Python packages.  While it is extremely
>convenient (especially when used with GNU/Stow), it does not seem to
>have caught on with other (backward? ;-) distros.  Debian basically
>adds the local prefix to site.py.  The default prefixes are:
>
>prefixes = [sys.prefix]
>
>Debian changes it to:
>
>prefixes = [os.path.join(sys.prefix, "local"), sys.prefix]
>  
>
Does debian have any way of telling distutils of the new location?  If 
we are
using setup.py to install the python modules, then it seems that our default
location should be the same as the one used by setup.py (otherwise, why
would we use setup.py at all wh

>I am not sure that David's approach is *the* optimal one.  Many VTK
>users are unlikely to have root access therefore installing to /usr/
>is entirely out of question.  In these cases it is best to do what is
>currently done -- install to CMAKE_PREFIX.  Basically the install
>should work for most common situations.
>  
>
I disagree that we should install to
  ${CMAKE_PREFIX}/lib/pythonx.x/site-packages,
as is currently done.  It might make sense to install in
 ${CMAKE_PREFIX}/lib/vtkx.x/python

The "make install" should work out-of-the-box for as many
python users as possible.   Right now, it only works "out-of-the-box"
for Redhat users that are installing VTK in /sys or for Debian users
who are installing VTK in /usr/local.  Everyone else needs to set
the PYTHONPATH befor it will work.

We can do much better than that!

I think we need two different Python install options in CMake:
- one that puts the modules in  ${CMAKE_PREFIX}/lib/vtkx.x/python, for 
non-administrators
- one that puts it wherever the distutils default is, for sysadmins

 - David




More information about the vtk-developers mailing list