如何在没有root特权的情况下安装python软件包?
我正在使用numpy
/scipy
/pynest
在Mac OS X上进行一些研究计算.为了提高性能,我们从大学租用了一个有400个节点的集群(使用Linux),以便可以执行以下任务:并行完成.问题是我们不允许在集群上安装任何额外的软件包(没有sudo
或任何安装工具),它们仅提供原始的python本身.
I am using numpy
/ scipy
/ pynest
to do some research computing on Mac OS X. For performance, we rent a 400-node cluster (with Linux) from our university so that the tasks could be done parallel. The problem is that we are NOT allowed to install any extra packages on the cluster (no sudo
or any installation tool), they only provide the raw python itself.
然后如何在群集上运行脚本?有什么方法可以集成模块(我认为numpy和scipy也具有一些已编译的二进制文件),以便可以在不安装软件包的情况下进行解释和执行?
How can I run my scripts on the cluster then? Is there any way to integrate the modules (numpy and scipy also have some compiled binaries I think) so that it could be interpreted and executed without installing packages?
您不需要root特权即可在主目录中安装软件包 .您可以使用诸如
You don't need root privileges to install packages in your home directory. You can do that with a command such as
pip install --user numpy
或从来源
python setup.py install --user
请参见 https://stackoverflow.com/a/7143496/284795
第一种选择更为方便,因此,如果服务器没有pip
或easy_install
,则应礼貌地请管理员添加它,并说明对他们的好处(它们将不再受到困扰)根据对单个包装的要求.
The first alternative is much more convenient, so if the server doesn't have pip
or easy_install
, you should politely ask the admins to add it, explaining the benefit to them (they won't be bothered anymore by requests for individual packages).