Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shodan radar exception on windows machines with curses missing. #206

Open
L1-0 opened this issue Dec 6, 2023 · 2 comments
Open

Shodan radar exception on windows machines with curses missing. #206

L1-0 opened this issue Dec 6, 2023 · 2 comments

Comments

@L1-0
Copy link

L1-0 commented Dec 6, 2023

Hi!

I'm getting the following error when trying to execute shodan radar on a windows machine after installing the latest shodan package via pip:

PS C:\Windows\system32> shodan radar
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Scripts\shodan.exe\__main__.py", line 7, in <module>
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\shodan\__main__.py", line 932, in radar
    from shodan.cli.worldmap import launch_map
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\shodan\cli\worldmap.py", line 15, in <module>
    import curses
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\curses\__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses' 

After executing pip install windows-curses, the error goes away. Thus i would propose a check for windows systems for this module as a solution or handle the exception and show this as a solution.

PS C:\Windows\system32> shodan version
1.30.1

Greetings

@L1-0 L1-0 changed the title Shodan radar exception on windows machines with ncurses missing. Shodan radar exception on windows machines with curses missing. Dec 6, 2023
@rmhowe425
Copy link
Contributor

rmhowe425 commented Feb 8, 2024

@achillean Per the official Python documentation:

"The Windows version of Python doesn’t include the curses module. A ported version called UniCurses is available."

Do we want to file a PR to update requirements.txt to import curses for windows based on platform? - i.e: https://stackoverflow.com/questions/29222269/is-there-a-way-to-have-a-conditional-requirements-txt-file-for-my-python-applica

@GiorgosXou
Copy link

GiorgosXou commented Nov 12, 2024

Just a note, UniCurses is outdated, use Uni-Curses instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants