英特尔macOS Big Sur上的自制pip第5599期

2024-09-30 20:33:07 发布

您现在位置:Python中文网/ 问答频道 /正文

(我是新来的,所以请温柔一点) 在2020 Intel 13“默认高规格MacBook Pro上的macOS big sur上,在homebrew中使用topgrade时(我在安装带有brew install topgrade的homebrew后安装了topgrade),遇到了以下问题:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

在web上寻找解决方案时,我发现:https://andreaolivato.medium.com/how-to-solve-the-invalid-active-developer-path-brew-error-after-updating-to-mac-os-catalina-10-15-e351e743dd23

按照建议我运行:xcode-select --install,然后重新启动

在再次运行topgrade后,当它说:

    ...
Successfully installed pip-21.1.1
    WARNING: You are using pip version 19.2.3, however version 21.1.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    ...

但我觉得,好吧,似乎它自己更新了。所以我再次运行topgrade,它说

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Requirement already satisfied: pip in ./Library/Python/3.8/lib/python/site-packages (21.1.1)

从那时起,我得到了相同的答案。我跟踪了链接,但除了python解决方案之外,没有找到其他解决方案,这似乎是一个短期解决方案。就目前而言,我既有pip版本19.2.3,也有21.1.1,需要删除旧版本,对吗?但我该怎么做呢? 而且Requirement already satisfied: pip in ./Library/Python/3.8/lib/python/site-packages (21.1.1)是否意味着它已经自行修复了?如果我忽略了这个问题会发生什么?如果有人能帮我解决这个问题,我将不胜感激。虽然我热爱技术,但我在这方面完全没有编码经验,这简直让我不知所措


Tags: installpiptheindeveloperversionlibraryerror