"pip install --user ..."的目的是什么? [英] What is the purpose of "pip install --user ..."?

查看:1474
本文介绍了"pip install --user ..."的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自pip install --help:

 --user      Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%\Python on
             Windows. (See the Python documentation for site.USER_BASE for full details.)

site.USER_BASE的文档是一个有趣的* NIX主题的虫洞,我不明白.

The documentation for site.USER_BASE is a terrifying wormhole of interesting *NIX subject matter that I don't understand.

--user的简单目的是什么?为什么将软件包打包到~/.local/会很重要?为什么不将可执行文件放在我的$ PATH中?

What is the purpose of --user in plain english? Why would intalling the package to ~/.local/ matter? Why not just put an executable somewhere in my $PATH?

推荐答案

pip默认将Python软件包安装到系统目录(例如/usr/local/lib/python3.4).这需要root用户访问权限.

pip defaults to installing Python packages to a system directory (such as /usr/local/lib/python3.4). This requires root access.

--user会在您的主目录中制作pip安装软件包,该软件包不需要任何特殊特权.

--user makes pip install packages in your home directory instead, which doesn't require any special privileges.

这篇关于"pip install --user ..."的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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