Summary 🍺 /usr/local/Cellar/sqlite/3.20.1: 11 -6ren">
gpt4 book ai didi

python - 为什么用brew安装python后是 "pip2"而不是 "pip"?

转载 作者:太空狗 更新时间:2023-10-30 00:53:32 28 4
gpt4 key购买 nike

我在我的mac 10.12.3上运行了brew install python,得到的日志如下:

==> Summary
🍺 /usr/local/Cellar/sqlite/3.20.1: 11 files, 3.0MB
==> Installing python
==> Downloading https://homebrew.bintray.com/bottles/python-2.7.13_1.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring python-2.7.13_1.sierra.bottle.tar.gz
==> /usr/local/Cellar/python/2.7.13_1/bin/python2 -s setup.py --no-user-cfg install --force --verbose --single-
==> /usr/local/Cellar/python/2.7.13_1/bin/python2 -s setup.py --no-user-cfg install --force --verbose --single-
==> /usr/local/Cellar/python/2.7.13_1/bin/python2 -s setup.py --no-user-cfg install --force --verbose --single-
==> Caveats
This formula installs a python2 executable to /usr/local/bin.
If you wish to have this formula's python executable in your PATH then add
the following to ~/.bash_profile:
export PATH="/usr/local/opt/python/libexec/bin:$PATH"

Pip and setuptools have been installed. To update them
pip2 install --upgrade pip setuptools

You can install Python packages with
pip2 install <package>

They will install into the site-package directory
/usr/local/lib/python2.7/site-packages

See: https://docs.brew.sh/Homebrew-and-Python.html
==> Summary

```

正如日志所说,除了 pip,我们还有 pip2 命令。这些应该如何发生?

最佳答案

因为 python2python3 安装可执行文件,如 pippython,Homebrew 安装每个可执行文件后缀23

用 Python 2 安装 pip 和用 Python 3 安装 pip3 的问题是人们倾向于依赖默认的、无后缀的版本。通过此更改,Homebrew 允许您选择要将哪个作为默认 python/pip 使用,例如别名或修改您的 PATH

关于python - 为什么用brew安装python后是 "pip2"而不是 "pip"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46167284/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com