sqlmapproject/sqlmap · error · SqlmapMissingDependence

missing 'curses' module (optional Python module). Use a Pyth

Error message

missing 'curses' module (optional Python module). Use a Python build that includes curses/ncurses, or install the platform-provided equivalent (e.g. for Windows: pip install windows-curses)

What it means

Error "missing 'curses' module (optional Python module). Use a Python build that includes curses/ncurses, or install the platform-provided equivalent (e.g. for Windows: pip install windows-curses)" thrown in sqlmapproject/sqlmap.

Source

Thrown at lib/utils/tui.py:914

                        self.scroll_offset = self.current_field - visible_lines + 1
            elif key == curses.KEY_ENTER or key == 10 or key == 13:  # Enter
                self._edit_field()
            elif key == curses.KEY_F2:  # F2 to run
                self._run_sqlmap()
            elif key == curses.KEY_F3:  # F3 to export
                self._export_config()
            elif key == curses.KEY_F4:  # F4 to import
                self._import_config()
            elif key == ord(' '):  # Space for boolean toggle
                option = tab['options'][self.current_field]
                if option['type'] == 'bool':
                    option['value'] = not option['value']

def runTui(parser):
    """Main entry point for ncurses TUI"""
    # Check if ncurses is available
    if curses is None:
        raise SqlmapMissingDependence("missing 'curses' module (optional Python module). Use a Python build that includes curses/ncurses, or install the platform-provided equivalent (e.g. for Windows: pip install windows-curses)")
    # ncurses waits ESCDELAY ms (default 1000) after Esc to disambiguate escape sequences, which
    # makes Esc feel like it hangs for ~1s; shrink it so Esc reacts immediately
    os.environ.setdefault("ESCDELAY", "25")
    try:
        # Initialize and run
        def main(stdscr):
            if hasattr(curses, "set_escdelay"):
                try:
                    curses.set_escdelay(25)
                except curses.error:
                    pass
            ui = NcursesUI(stdscr, parser)
            ui.run()

        curses.wrapper(main)

    except Exception as ex:
        errMsg = "unable to create ncurses UI ('%s')" % getSafeExString(ex)

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at lib/utils/tui.py:914 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/acdd862974e0239e. Report an issue: GitHub.