On a lab machine where I can't just go clobbering things, there appears to be more than one version of python installed.
If I python --version I see 2.7.1.
I've installed numpy via "apt-get install numpy" and it says it is installed, but when I try to import it it isn't found.
When I do a find on the machine for numpy I see it in the /usr/lib/python2.5/site-packages/numpy folder. I assume this is the problem... that apt-get put it in the 2.5 version instead of the 2.7.
How do I resolve this? Is there a way to tell apt-get which python I'm talking about when I do an install? Or do I abandon aptitude and use pip or something?
Debian allows for multiple Pythons to be installed (the
python2.5
andpython2.6
packages). A Python library like numpy in the packagepython-numpy
can support multiple of these, but particular libraries installed through the package manager are not necessarily supported on all of these. You can useapt-cache show python-numpy | grep Python-Version
to see which versions are supported. If 2.7 is not supported, you'll have to install from source or (e.g.) pip, easy_install, etc.However, you may have a local installation of Python 2.7 (compiled and installed from sources outside of the repos). Your distro sounds a little out of date (on Linux Mint 12, only 2.6 and 2.7 are supported for numpy), so it's possible there aren't official packages for Python 2.7. If you do
which python
and it's in/usr/local
or anywhere other than/usr/bin
, then you've got a local installation and you will need to install the package using source or easy_install and friends.That said, my opinion is that if you just need these libs for development, you should keep them in a sandbox (like
virtualenv
) in your home directory. That way you have better control over the exact version you have.