pip3
在最新的 Homebrewpython3
更新后消失了。
user:~$ python3 --version
Python 3.7.3
user:~$ pip3 --version
-bash: pip3: command not found
Homebrew 声称它安装了符号链接,pip3
但是它们并不存在:
user:~$ brew info python
python: stable 3.7.3 (bottled), HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python/3.7.3 (8,115 files, 114.3MB) *
Built from source on 2019-04-02 at 15:12:30
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/python.rb
==> Dependencies
Build: pkg-config ✔
Required: gdbm ✔, openssl ✔, readline ✔, sqlite ✔, xz ✔
==> Options
--HEAD
Install HEAD version
==> Caveats
Python has been installed as
/usr/local/bin/python3
Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
/usr/local/opt/python/libexec/bin
If you need Homebrew's Python 2.7 run
brew install python@2
You can install Python packages with
pip3 install <package>
They will install into the site-package directory
/usr/local/lib/python3.7/site-packages
See: https://docs.brew.sh/Homebrew-and-Python
==> Analytics
install: 506,030 (30 days), 1,433,297 (90 days), 3,912,271 (365 days)
install_on_request: 248,801 (30 days), 764,732 (90 days), 2,361,156 (365 days)
build_error: 0 (30 days)
user:~$ ll /usr/local/opt/python/libexec/bin
total 0
0 drwxr-xr-x 6 user admin 192 Apr 2 15:12 .
0 drwxr-xr-x 6 user admin 192 Apr 2 15:12 ..
0 lrwxr-xr-x 1 user admin 58 Apr 2 15:12 idle -> ../../Frameworks/Python.framework/Versions/3.7/bin/idle3.7
0 lrwxr-xr-x 1 user admin 59 Apr 2 15:12 pydoc -> ../../Frameworks/Python.framework/Versions/3.7/bin/pydoc3.7
0 lrwxr-xr-x 1 user admin 60 Apr 2 15:12 python -> ../../Frameworks/Python.framework/Versions/3.7/bin/python3.7
0 lrwxr-xr-x 1 user admin 68 Apr 2 15:12 python-config -> ../../Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config
user:~$ ll /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/bin/
total 104
0 drwxr-xr-x 16 user staff 512 Apr 2 16:16 .
0 drwxr-xr-x 9 user staff 288 Mar 25 14:59 ..
0 lrwxr-xr-x 1 user staff 8 Mar 25 14:59 2to3 -> 2to3-3.7
8 -rwxr-xr-x 1 user staff 162 Apr 2 16:16 2to3-3.7
0 lrwxr-xr-x 1 user staff 7 Mar 25 14:59 idle3 -> idle3.7
8 -rwxr-xr-x 1 user staff 160 Apr 2 16:16 idle3.7
0 lrwxr-xr-x 1 user staff 8 Mar 25 14:59 pydoc3 -> pydoc3.7
8 -rwxr-xr-x 1 user staff 145 Apr 2 16:16 pydoc3.7
0 lrwxr-xr-x 1 user staff 9 Mar 25 14:59 python3 -> python3.7
0 lrwxr-xr-x 1 user staff 16 Mar 25 14:59 python3-config -> python3.7-config
32 -rwxr-xr-x 1 user staff 13620 Apr 2 16:16 python3.7
0 lrwxr-xr-x 1 user staff 17 Mar 25 14:59 python3.7-config -> python3.7m-config
32 -rwxr-xr-x 1 user staff 13620 Apr 2 16:16 python3.7m
8 -rwxr-xr-x 1 user staff 2103 Apr 2 16:16 python3.7m-config
0 lrwxr-xr-x 1 user staff 10 Mar 25 14:59 pyvenv -> pyvenv-3.7
8 -rwxr-xr-x 1 user staff 502 Apr 2 16:16 pyvenv-3.7
brew cleanup
并且brew reinstall python
不起作用。我也在使用pyenv
,我想知道这是否会引起任何问题。现在我已经卸载了所有python
版本pyenv
并重新安装了最新的 Homewbrew 版本,但仍然没有成功。
PS:我知道python3 -m pip
命令,但正在寻找恢复标准调用的方法pip3
。