我在我的 Windows 7 (x64) 机器上安装了正在运行的 Python 2.7/3.4。我想在 Windows 上测试 curses。
诅咒已安装但无法正常工作:
>>> import curses
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Tools\Python3.4.2\lib\curses\__init__.py", line 13, in <module>
from _curses import *
ImportError: No module named '_curses'
文档说:
因此,Python 3.4 的 Windows 安装程序安装了未解决依赖关系的 curses。可以将其命名为错误...
好的,我研究了 UniCurses。它是PDCurses的包装器:
UniCurses 是 Python 2.x/3.x 的包装器,它在所有平台(MS Windows、Linux 和 Mac OS X)上提供了一组统一的 Curses 函数,语法接近原始 NCurses。为了在 Microsoft Windows 系统上提供 Curses 功能,它包装了 PDCurses。
通过安装 UniCursespip3
会导致错误:
C:\Users\Paebbels>pip3 install UniCurses
Downloading/unpacking UniCurses
Could not find any downloads that satisfy the requirement UniCurses
Some externally hosted files were ignored (use --allow-external UniCurses to allow).
Cleaning up...
No distributions at all found for UniCurses
Storing debug log for failure in C:\Users\Paebbels\pip\pip.log
Python 的 UniCurses 站点上的 SourceForge 链接已失效。手动搜索 SourceForge 有助于再次找到适用于 Python 的 UniCurses。
但是,UniCurses 1.2 安装程序在我的 Windows 注册表中找不到任何 Python 安装。(Python 2.7.9 和 Python 3.4.2 可用)。
我还研究了公共领域诅咒(PDCurses)。PD Cureses 3.4 是从 2008 年底开始的。所以它已经 7 岁了。我不相信它适用于 Windows 7、Windows 8.1 或 Windows 10。
有什么方法可以使用 Python 在 Windows 上运行诅咒。
(Windows Python,不是 CygWin Python!)