这是我第一次尝试使用curses,在通过python -m pip install windows-curses
成功安装它之后,(重新运行此代码将得到Requirement already satisfied: windows-curses in c:\python\python37-32\lib\site-packages (2.1.0)
)。
我运行了示例代码:
import curses
import time
screen = curses.initscr()
screen.clear()
time.sleep(3)
出现错误:
ModuleNotFoundError Traceback (most recent call last)
c:\Users\Cris\Desktop\test.py in
----> 1 import curses
2 import time
3 screen = curses.initscr()
4 screen.clear()
5 time.sleep(3)
~\Anaconda3\lib\curses\__init__.py in
11 """
12
---> 13 from _curses import *
14 import os as _os
15 import sys as _sys
ModuleNotFoundError: No module named '_curses'
其中说未安装curses ...?
我使用VSC的“ Python交互式”标签(shift+enter
来运行它,只需通过VSC运行它即可:
LINES value must be >= 2 and <= 132: got 13682
initscr(): Unable to create SP
答案 0 :(得分:1)
Windows专用的Python不附带curses.go到curses,下载与您的Windows和Python版本相对应的curses版本,然后使用python pip安装whl文件