4

我如何得到一个点垫片~/.pyenv/shims。我正在使用 pyenv,但which pip仍然显示 pip 的系统版本。

根据从文档复制的以下评论,它似乎应该通过重新散列发生,但我已经运行pyenv rehash并且没有任何反应

从文档复制:

Through a process called rehashing, pyenv maintains shims in that directory to match every Python command across every installed version of Python—python, pip, and so on.

根据评论中的请求,这里是我的 PATH

/Users/patrick/google-cloud-sdk/bin:/Users/patrick/.pyenv/shims:/Users/patrick/.pyenv/bin:/Users/patrick/.local/bin:/Users/patrick/npm/bin:/Users/patrick/google_appengine:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mongodb/bin

这是我的~/.pyenv/shims内容:

$ ll ~/.pyenv/shims/ total 80 drwxr-xr-x 12 patrick staff 408 May 23 09:49 . drwxr-xr-x 22 patrick staff 748 May 4 18:10 .. -rwxr-xr-x 1 patrick staff 408 May 4 18:15 2to3 -rwxr-xr-x 1 patrick staff 408 May 4 18:15 idle -rwxr-xr-x 1 patrick staff 408 May 4 18:15 pydoc -rwxr-xr-x 1 patrick staff 408 May 4 18:15 python -rwxr-xr-x 1 patrick staff 408 May 4 18:15 python-config -rwxr-xr-x 1 patrick staff 408 May 4 18:15 python2 -rwxr-xr-x 1 patrick staff 408 May 4 18:15 python2-config -rwxr-xr-x 1 patrick staff 408 May 4 18:15 python2.7 -rwxr-xr-x 1 patrick staff 408 May 4 18:15 python2.7-config -rwxr-xr-x 1 patrick staff 408 May 4 18:15 smtpd.py

4

1 回答 1

0

所有 shim 文件实际上似乎都是相同的,因此您应该始终能够做到cp ~/.pyenv/shims/{python,pip}.

于 2020-05-06T11:53:41.807 回答