gpt4 book ai didi

python - 用 pyenv 填充 pip

转载 作者:行者123 更新时间:2023-12-03 21:34:58 24 4
gpt4 key购买 nike

我如何在 ~/.pyenv/shims 中获得 pip shim .我正在使用 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

最佳答案

所有的 shim 文件实际上看起来都是一样的,所以你应该总是可以做 cp ~/.pyenv/shims/{python,pip} .

关于python - 用 pyenv 填充 pip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37038081/

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