2

I need to install the h5py Python module, and all its absent dependencies, on a Debian Linux system. This task is complicated by the following:

  1. I don't have any superuser privileges on this system (no sudo, no root password, etc.);
  2. the rest of the code I am using requires version 2.7 of Python, which is not the default version installed in this system (although Python 2.7 is available under /opt/python-2.7.1).

The ideal solution would be one that would enable me to use the dependency info in the python-h5py Debian package (wheezy release) to orchestrate the installation of all the missing prerequisites for h5py. Is there a way to do this? If so how can I specify the version of Python under /opt/python-2.7.1 as the one to use?

Any suggestions on how best to do this would be appreciated!

kjo
  • 33,683
  • 52
  • 148
  • 265
  • Is hdf5 already installed on your system or do you have to do a userland install for that too? – matt Jun 22 '11 at 18:22
  • hdf5 is installed, but it's a version older than that required by the version of h5py I want, so yes, I need to install hdf5 as well. – kjo Jun 23 '11 at 08:59

2 Answers2

2

This should be possible using virtualenv. You would create a virtualenv like this (at the command line):

virtualenv -p /opt/python-2.7.1 mypythonenv

Last bit is the name of a new folder for the environment to go in.

Then:

cd mypythonenv
source bin/activate

Then you can install whatever Python modules you want, and they will be installed in the virtualenv, without requiring any superuser privileges. As far as I know, you can't use .deb packages there, but you can use Python installers like pip or easy_install inside it.

Thomas K
  • 39,200
  • 7
  • 84
  • 86
  • Have you *ever* installed and *run* numpy on Debian using the pip or easy_install as you say? – kjo Jun 23 '11 at 08:57
  • @kjo: I use Ubuntu. I've installed numpy from source at some point, although I don't think I used one of the installers. It needs certain header files to link against, so it may be easier to compile it on a system where you can install the necessary packages, and transfer it across. – Thomas K Jun 23 '11 at 11:40
  • 1
    @sygi Now I would recommend installing [Anaconda](https://www.continuum.io/downloads), or its cousin Miniconda if you prefer a small initial download followed by installing more packages yourself. That can install libraries like libhdf5 without requiring root access. It was not available in 2011, though. – Thomas K May 20 '16 at 11:19
1

This is overkill and not a Free solution, but you can install Enthought Python Distribution. HDF5, h5py and (my favorite) pytables come for free. Building numpy is a pain and it is often easier to let someone do the packaging for you. It is free for academic usage.

matt
  • 4,089
  • 1
  • 20
  • 17