1

I'm running TheHarvester tool on Windows 10. How to resolve this error?

C:\Users\xxx\Desktop

theharvester Traceback (most recent call last): File "E:\PentestBox\bin\InformationGathering\theHarvester\theHarvester.py", line 6, in import asyncio ImportError: No module named asyncio

https://i.stack.imgur.com/z29Wz.png

enter image description here

enter image description here

Thank you

jossefaz
  • 3,312
  • 4
  • 17
  • 40
Alves Salva
  • 11
  • 1
  • 4

1 Answers1

2

SHORT ANSWER

This package (theHarevest.py) has a dependecy (uvloop.py) that is not supported on windows (related issue : https://github.com/MagicStack/uvloop/issues/14)

Two solutions to get it run :

1) Virtual machine (using VirtualBox with a Linux image for example)

2) Docker for windows (I personaly prefer this solution because it is by far more easy to run and consume less resources even if it runs its own linux virtual machine under the hood) :

Here is one image of theHarvester that seems to be really simple to run : https://hub.docker.com/r/beardyjay/theharvester/

You just have to install Docker on windows and run this image as explained in this link

EXTRA 1

Now just by the way (not really related to the windows support problem) : you installed the asyncio package in your C:\ driver. (You did pip install asyncio on C:). But you tried to run theHarvester.py on your E:\ driver....

If you have Python also installed on E: just do E: on your command prompt to switch to E and then do pip install asyncio there.

But the better practice would be to work with the same python installation on your machine so you could do :

C:\<YOUR_PATH_TO_PYTHON.EXE> E:\PentestBox\bin\InformationGathering\theHarvester\theHarvester.py

(this assuming that E:\ belongs to the same machine and is not a mapping to another machine)

Of course, because the Harvester not supported yet on windows, those installation won't be usefull....but this was just to explain the import problem

EXTRA 2:

As i mentioned here Does a python virtual environment avoid redundant installs?

it is also a better practice to work with virtual environments. You should check this out too...

jossefaz
  • 3,312
  • 4
  • 17
  • 40
  • I'm using Python in C: |........... E: \ and C: \ on the same machine. I unzipped Winpython in E: \ driver And now? What do I do? I added a new photo to the question. Thanks! – Alves Salva May 15 '20 at 05:04
  • Now you should be able to run the theHarvester.py without the import problem...try an let us know if it's okay – jossefaz May 15 '20 at 05:20
  • It doesn't run. I added a new photo2 to the question – Alves Salva May 15 '20 at 05:25
  • As you noticed : theHarvester.py has a dependecy (uvloop) that is not supported on windows for the moment...please see here for more information https://github.com/MagicStack/uvloop/issues/14 – jossefaz May 15 '20 at 05:56