1
root@kali:~# ./collecting_info_using_facets.py apache 
Traceback (most recent call last):
  File "./collecting_info_using_facets.py", line 3, in <module>
    import shodan
ImportError: No module named shodan

I included path as #!usr/bin/env python but then also I cannot import shodan from the command line but I can run the same program from python3 IDLE.

Netwave
  • 40,134
  • 6
  • 50
  • 93
Pran Kumar Sarkar
  • 953
  • 12
  • 26
  • 3
    Have you installed the shodan module? – Serge Ballesta Dec 21 '17 at 16:41
  • are you sure you are running python3 and not 2? It seems you may have installed the shodan library for python3 (hence IDLE can run) but not for 2 (which I suspect you are running on the command line). – Yohst Dec 21 '17 at 16:49

1 Answers1

1

It's because you need to download the Python module called 'Shodan'. You don't seem to have it installed, that's why Python is returning the error: ImportError: No module named shodan

You can install Shodan for Python3 via:

pip3 install shodan

Or if you're running Python2, try:

pip2.7 install shodan

Best of luck.

  • I had it installed but i think the problem is related to namespace configuration. – Pran Kumar Sarkar Jun 18 '19 at 15:18
  • What version of Python were you using? Also, it was an import error. You didn't have it downloaded for your specific Python version. – CrimsonTorso Jun 18 '19 at 16:12
  • 1
    I am using Python 3. Bdw now its solved. I formatted my OS due to some reason and after that when I reinstalled the same using `python -m pip install shodan` so now its working. – Pran Kumar Sarkar Jun 20 '19 at 06:30