How to move old libraries of previous version python to new version of python
Question: I am using Ubuntu. I install newer version of python. But all my installed
libraries such as imdbPy, NumPy, Cython etc. can run in previous version of
python whose version number is 2.6.6.

When I import Cython in 2.6.6, tt works, but I try same thing in 2.7.0+
version of python

    
    
    import cython
    

occurs an error as following:

    
    
    import cython
    ImportError: No module named cython
    

What I need is to change default version of python which is used in bash. I
think, I can handle it by modifying bash profile file. I also want to move all
of these libs to appropriate place so that new version of python can reach
them permanently.


Answer: Don't mess with your system installs - the package manager should be
responsible for that. Make sure that when you install from source, you do it
in a separate directory.

I install things in my home directory. I like jhbuild so this is what I use to
maintain different versions of python side by side:
<https://thomas.apestaart.org/thomas/trac/browser/jhbuild/python>

Running make from that checkout will build python 2.3-2.7 and create scripts
to go into their environment:

    
    
    [thomas@level ~]$ py-2.4 
    Entering interactive py shell /bin/bash
    [py-2.4] [thomas@level ~]$ python
    Python 2.4.5 (#1, Dec 16 2010, 18:51:06) 
    [GCC 4.4.4 20100630 (Red Hat 4.4.4-10)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 
    

