如何在Debian Linux系统上安装h5py(+ numpy + libhdf5 + ...)作为非root用户 [英] How to install h5py (+numpy+libhdf5+...) as non-root on a Debian Linux system

查看:593
本文介绍了如何在Debian Linux系统上安装h5py(+ numpy + libhdf5 + ...)作为非root用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Debian Linux系统上安装h5py Python模块及其所有缺少的依赖项。这个任务是复杂的:

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. 我没有任何超级用户权限在这个系统上(没有sudo,没有root密码等。);

  2. 我使用的其余代码需要2.7版本的Python,这不是该系统中安装的默认版本(尽管Python 2.7可用于/ opt / python- 2.7.1)。

理想的解决方案是使我能够在python-h5py Debian软件包中使用依赖关系信息(wheezy release)来编排h5py的所有缺少的先决条件的安装。有没有办法做到这一点?如果是这样,我可以在/opt/python-2.7.1下面指定Python的版本吗?

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!

推荐答案

应该可以使用 virtualenv 。您将创建一个这样的virtualenv(在命令行中):

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.

然后:

cd mypythonenv
source bin/activate

然后,您可以安装任何所需的Python模块,并将它们安装在virtualenv中,而不需要任何超级用户权限。据我所知,您不能在其中使用.deb包,但您可以在其中使用Python安装程序,如pip或easy_install。

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.

这篇关于如何在Debian Linux系统上安装h5py(+ numpy + libhdf5 + ...)作为非root用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆