简体   繁体   English

使其他非root用户可以以root用户身份安装python库

[英]Making python libraries installed as root accessible by other non-root users

I'm not a sys admin guy, but I am tasked (due to budget limitations) to set up a VM server for a web app. 我不是系统管理员,但由于预算限制,我受命为Web应用程序设置VM服务器。 I did my best to figure most things out, but when I try to install Python modules as root, I cannot use them in other non-root accounts that I created. 我尽了最大的努力弄清楚了所有事情,但是当我尝试以root用户身份安装Python模块时,无法在我创建的其他非root用户帐户中使用它们。

For example, I installed Twilio python library as root. 例如,我以root身份安装了Twilio python库 But when I log in as "userjoe" and try to run a sample script using twilio, it doesn't work. 但是,当我以“ userjoe”身份登录并尝试使用twilio运行示例脚本时,它不起作用。

What should I do to make libraries installed as root accessible by non-root users? 如何使非root用户可以以root用户身份安装库? Thank you. 谢谢。

ps I'm tagging this post as "python" and a few other in case someone from that community knows the answer. ps我把这个帖子标记为“ python”,还有一些其他的标记,以防该社区的某人知道答案。 Please let me know if my tags are irrelevant. 如果我的标签不相关,请告诉我。

如果Python模块仅由一个用户使用,则可以使用该用户(userjoe)登录并使用PIP的--user参数将其安装到用户的主目录中:

pip install twilio --user

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM