【问题标题】:Unable to find module install name / install module in Python无法在 Python 中找到模块安装名称/安装模块
【发布时间】:2023-02-07 07:35:21
【问题描述】:

如果这令人困惑,请道歉......我今天大部分时间都在尝试在我的 Python 实例中安装“shutil”模块。我已经尝试了我认为来自 pypi.org 的正确模块,但无济于事。我已从 3.10 升级到 3.11,收到的消息没有任何变化。我确信 pip 安装过程可以正常工作,因为我能够很好地安装其他模块。尽管我进行了尝试,但我仍继续收到此消息:

pip install shutil
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement shutil (from versions: none)
ERROR: No matching distribution found for shutil

是的,我已经看到了许多其他解决方案,但到目前为止它们似乎对我不起作用。我什至在某个地方读到它现在是一个包含的模块。这促使我升级我的 Python 实例。我还尝试在我的 pip 安装尝试中包括 --trusted-host 。也许我错过了一些 Python 配置?为 Python 3.11 安装更新了环境路径。

--更正错别字

【问题讨论】:

  • shutil 是一个内置模块,你不需要安装它

标签: python pip


【解决方案1】:

shutil 是一个内置模块,而不是您必须安装的模块。只需致电

import shutil

在你的 python 代码的顶部

【讨论】:

    猜你喜欢
    • 2019-07-07
    • 1970-01-01
    • 1970-01-01
    • 2019-07-27
    • 1970-01-01
    • 2020-12-03
    • 2020-10-23
    • 2017-05-30
    • 2018-11-02
    相关资源
    最近更新 更多