Python 3.9.5中的curses在哪里?

3

我刚从3.6版本升级,但在pip列表中找不到curses。当我尝试运行我的程序时,出现以下错误:


Traceback (most recent call last):
  File "/media/HD/Documents/Python/program/menu.py", line 1, in <module>
    import curses
  File "/usr/local/lib/python3.9/curses/__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses'

"pip3 install curses" 给我返回:
ERROR: Could not find a version that satisfies the requirement curses (from versions: none)
ERROR: No matching distribution found for curses

有什么想法吗?Python不再附带curses了吗? 编辑:这是在Ubuntu系统中。

你是在用Windows电脑吗? - undefined
这是在Linux上 - undefined
我相信你在寻找的是叫做unicurses的东西,但是我可能错了,因为我不是一个Linux用户。 - undefined
这个回答解决了你的问题吗?Error no module named curses - undefined
3个回答

2
我使用以下命令解决了这个问题。它在Windows上增加了对标准Python curses模块的支持。 在这里了解更多信息。

pip install windows-curses


0

我通过使用较早版本的Python(3.6.9)解决了这个问题。

不幸的是,这可能是唯一的解决方案。


0

对于 Linux,您需要安装 UniCurses,它是与操作系统无关的。请注意,UniCurses 已经有一段时间没有得到维护了,但您可以在 这里 找到更多信息。


安装不成功。"致命错误:此Python版本不支持ctypes,请升级您的Python发行版,如果您想在Linux平台上使用UniCurses。"但我正在使用最新版本的Python 3.9.5。 - undefined
鉴于UniCurses的年代久远,很有可能它与最新版本的Python不兼容。 - undefined
https://pypi.org/project/Uni-Curses/ https://github.com/unicurses/unicurses#installing-unicurses - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接