brainstorm
brainstorm

Reputation: 11

associate python packages to a different version of python on ubuntu

I am using ubuntu 11.04, which comes with the system-wide python 2.6. Now, I installed the python2.7 in addition to the v2.6.

Now, the question is, if I want to install the latest version of numpy, scipy, matplotlib, etc to make them associated with the python2.7, what should I do to make sure they are not associated with the python 2.6?

Thanks. J.

Upvotes: 1

Views: 165

Answers (3)

xvatar
xvatar

Reputation: 3259

Seems like this post answers your question:

Newbie hint on installing Python and it’s modules and packages

You install every Python separately, you install every module and package separately in those Python install, and you use everything explicitly.

Upvotes: 0

kojiro
kojiro

Reputation: 77079

You have a few options. Which is best depends on what you want to use those libraries for. If you're doing development, virtualenv is a good idea:

$ virtualenv -p /usr/bin/python2.7 py27env && . py27env/bin/activate
py27env$ pip install numpy scipy matplotlib

Upvotes: 1

unclejamil
unclejamil

Reputation: 445

Pull down the latest tarballs for numpy, scipy, and matplotlib. You can get numpy and scipy from here:

http://scipy.org/Download

Matplotlib can be found here:

http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/

Then open up a terminal and use python 2.7 to install them using the setup.py scripts that come with the tarballs. For example, do the following for numpy (assuming you've pulled down the latest tarball already from sourceforge and it's sitting on your desktop:

   $ mv Desktop/numpy-1.6.2.tar.gz /tmp/
   $ cd /tmp/
   $ tar -xvzf numpy-1.6.2.tar.gz 
   $ cd numpy-1.6.2
   $ python2.7 setup.py install

That should do it. Tarballs for python code generally come with a setup.py script that will install things in the right place for the version of python you run it with.

Upvotes: 0

Related Questions