How to install h5py (+numpy+libhdf5+…) as non-root on a Debian Linux system

拟墨画扇 提交于 2020-01-04 07:35:07

问题


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!


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/6442754/how-to-install-h5py-numpylibhdf5-as-non-root-on-a-debian-linux-system

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!