14

hello guys I have downloaded a script that require gevent python library and every time I run the script it says :

 File "shodan.py", line 7, in <module>
   from gevent import monkey
 File "C:\Python27\lib\site-packages\gevent\__init__.py", line 48, in <module>
   from gevent.greenlet import Greenlet, joinall, killall
 File "C:\Python27\lib\site-packages\gevent\greenlet.py", line 6, in <module>
   from gevent.hub import greenlet, getcurrent, get_hub, GreenletExit, Waiter
 File "C:\Python27\lib\site-packages\gevent\hub.py", line 30, in <module>
   greenlet = __import__('greenlet').greenlet    
ImportError: No module named greenlet

I have successfully downloaded and installed gevent and i'm just confused can someone give me the solution and explain the problem.

Reality Returns
  • 180
  • 1
  • 1
  • 8

4 Answers4

15

Try to install greenlet via pip like so: pip install greenlet.

aga
  • 27,954
  • 13
  • 86
  • 121
1

This is how I do it to make it work:

  1. Download the latest gevent source from github: gevent
  2. replace the source code in C:\Python27\lib\site-packages\gevent\ with the download source code.
chuan
  • 813
  • 1
  • 6
  • 20
0

while running the command

python app.py

instead try

python2.7 app.py

worked for me ....

0

Assuming you have gevent installed:

Check that you don't have another file in the same folder named as gevent.py, because if yes then when you do "import gevent" it's importing/calling that file that you named gevent.py.

Change the filename and it should work.

Slipstream
  • 13,455
  • 3
  • 59
  • 45