Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gevent library: "Import Error: no module named greenlet"

Tags:

python

gevent

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.

like image 341
Reality Returns Avatar asked Sep 07 '12 16:09

Reality Returns


2 Answers

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

like image 178
aga Avatar answered Nov 16 '22 11:11

aga


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.
like image 1
chuan Avatar answered Nov 16 '22 11:11

chuan