如何在没有root特权的情况下安装python软件包? [英] How to install python packages without root privileges?

查看:137
本文介绍了如何在没有root特权的情况下安装python软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用numpy/scipy/pynest在Mac OS X上进行一些研究计算.为了提高性能,我们从大学租用了一个有400个节点的集群(使用Linux),以便可以执行以下任务:并行完成.问题是我们不允许在集群上安装任何额外的软件包(没有sudo或任何安装工具),它们仅提供原始的python本身.

I am using numpyscipy / 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

第一种选择更为方便,因此,如果服务器没有pipeasy_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).

这篇关于如何在没有root特权的情况下安装python软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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