0

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

  • Does this answer your question? [Py2Exe - can't find modules](https://stackoverflow.com/questions/34250217/py2exe-cant-find-modules) – Sheena Mar 09 '22 at 01:19
  • Does this answer your question: https://stackoverflow.com/questions/34250217/py2exe-cant-find-modules – Sheena Mar 09 '22 at 01:19
  • no it doesn't help it still says " Traceback (most recent call last): File "main.py", line 1, in File "", line 259, in load_module File "curses\__init__.pyc", line 13, in ModuleNotFoundError: No module named '_curses' " and i added "options = { "py2exe":{ "packages": ["curses",] } }" and i still get the error – shortpupper Mar 09 '22 at 22:34

0 Answers0