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

查看:55
本文介绍了“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).这需要根访问权限.

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天全站免登陆