ModuleNotFoundError:没有名为“_curses”的模块;当尝试在 py2exe 中使用curses时
我正在尝试运行我的python代码:
import curses, random
def main(stdscr):
stdscr.clear()
for i in range(0, 21):
stdscr.addstr(i, 0, f'count {i+1}, and rand value {random.randint(0, 100)}')
stdscr.refresh()
stdscr.getkey()
curses.wrapper(main)
print("ngos")
然后我将其用于py2exe:
from distutils.core import setup
import py2exe
setup(windows=[{"script":"main.py"}], options = {"py2exe":{"packages": ["curses",]}})
但是当我尝试运行exe时,我从日志中得到以下信息:
Traceback (most recent call last):
File "main.py", line 1, in <module>
File "<frozen zipimport>", line 259, in load_module
File "curses\__init__.pyc", line 13, in <module>
ModuleNotFoundError: No module named '_curses'
我正在使用win10 x64
my python code I'm trying to run:
import curses, random
def main(stdscr):
stdscr.clear()
for i in range(0, 21):
stdscr.addstr(i, 0, f'count {i+1}, and rand value {random.randint(0, 100)}')
stdscr.refresh()
stdscr.getkey()
curses.wrapper(main)
print("ngos")
then I use this for py2exe:
from distutils.core import setup
import py2exe
setup(windows=[{"script":"main.py"}], options = {"py2exe":{"packages": ["curses",]}})
but when I try and run the exe I get this from the log:
Traceback (most recent call last):
File "main.py", line 1, in <module>
File "<frozen zipimport>", line 259, in load_module
File "curses\__init__.pyc", line 13, in <module>
ModuleNotFoundError: No module named '_curses'
I'm using win10 x64
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论