【问题标题】:Installing a module in Python在 Python 中安装模块
【发布时间】:2021-10-17 18:08:50
【问题描述】:

我想在 python 中安装 curses 模块,但我总是遇到这个问题:

PS C:\Users\#####\Desktop\Python> pip install curses
ERROR: Could not find a version that satisfies the requirement curses (from versions: none)
ERROR: No matching distribution found for curses

我还是编码新手,这是我第一次使用 Stackoverflow 请帮忙:(

【问题讨论】:

  • 任何答案都解决了您的问题吗?

标签: python python-curses


【解决方案1】:

使用

pip install windows-curses

参考:this

或者如果运行 python3 可能使用pip3

【讨论】:

    【解决方案2】:

    使用pip install windows-curses,就像使用 Windows 一样。默认curses模块不支持windows。

    【讨论】:

    • 当我按照你告诉我的操作时,出现一条消息“成功安装 windows-curses-2.2.0”,我认为它有效,但是当我开始使用 vs 代码时,它显示“ModuleNotFoundError:没有名为‘的模块’ _curses'" :(
    • 你是如何导入这个的?看到它是windows-curses 而不是windows_curses,我不确定,但他们还不支持来自PYPI 轮子的python3.8 and +。所以,也许它与你的 python 版本不兼容。我建议您打开一个问题 here 以获得与此相关的更明确和具体的支持以及您的所有错误和环境详细信息。
    • 我是用你评论中的复制粘贴来写的。我的 Python 版本是 v2021.10.1336267007 所以可能是版本问题
    • 使用python -Vpython --version检查python版本并将其报告给我上面提到的项目存储库中的问题。
    【解决方案3】:

    你需要安装windows-curses https://pypi.org/project/windows-curses/ 祝你好运 ;-) 最好的问候!

    pip install windows-curses
    

    【讨论】:

    • 我厌倦了,但此消息不断出现“ModuleNotFoundError: No module named '_curses'” :(
    • @Feras 你安装了哪个操作系统、pip 和 python 版本?顺便说一句,这个错误是在使用这个模块而不是用 pip 安装时发生的???也许你弄错了?
    • 推断你安装的包是正确的,只是你使用它有问题......
    • Windows 10,python v2021.10.1336267007,我不知道我用的是什么pip版本,我什至不知道怎么知道。当我尝试 pip install windows-curses 时,它说要求已经满足,但我仍然遇到无模块问题
    • @Feras 检查 pip 版本 => 输入 cmd "pip --version" 检查 python 版本 => 输入 cmd "python --version" :-))
    猜你喜欢
    • 2011-06-03
    • 2020-04-29
    • 2011-12-28
    • 1970-01-01
    • 2017-07-24
    • 2016-04-08
    • 2023-02-07
    相关资源
    最近更新 更多