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:
- I don't have any superuser privileges on this system (no 开发者_开发百科sudo, no root password, etc.);
- 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!
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.
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.
精彩评论