Common practice for multiple python versions sharing 3rd party modules

Daniel Fetchinson fetchinson at googlemail.com
Sat Apr 9 07:40:51 EDT 2011


Hi folks,

In order to test my own modules with various python versions I've
installed python 2.4, 2.5, 2.6, 2.7, 3.1, 3.2. The original
installation on my fedora box was 2.6 and all 3rd party modules so far
were installed under /usr/lib/python2.6/site-packages. Since now the
executable 'python' points to python 2.7 and lot of programs have
#!/usr/bin/env python at the top, these programs try to use 2.7. But
there are no 3rd party modules installed for 2.7 so programs that need
these do not run. Of course I can just replace #!/usr/bin/env python
with #!/usr/bin/env python2.6 but doing so for all programs would be a
pain.

Also, once I have a 3rd party module installed in
/usr/lib/python2.6/site-packages I wouldn't want to copy all of these
to /usr/lib/pythonX.Y/site-packages (assuming they are compatible with
pythonX.Y).

What would be the most common practice for having a single location
for 3rd party modules and all python versions could have access to
them?

Cheers,
Daniel


-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown



More information about the Python-list mailing list