After installing gevent via pip install gevent, I cannot import gevent.pywsgi
pip install gevent
gevent.py:
from gevent.pywsgi import WSGIServer
from app import app
http_server = WSGIServer(('', 8080), app)
http_server.serve_forever()
Hopefully this is enough to reproduce. If not I can include the project I'm attempting to use gevent with
> python gevent.py
Traceback (most recent call last):
File "gevent.py", line 1, in <module>
from gevent.pywsgi import WSGIServer
File "G:\Git\statistics-viewer\gevent.py", line 1, in <module>
from gevent.pywsgi import WSGIServer
ImportError: No module named pywsgi
If your script is named gevent.py, you're going to have a conflict with the gevent _package_. Try naming your script something else.
Python 3 produces a cleaner error message:
$ echo 'import gevent.pywsgi' >> gevent.py
$ python gevent.py
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 2218, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "gevent.py", line 1, in <module>
import gevent.pywsgi
File "gevent.py", line 1, in <module>
import gevent.pywsgi
ImportError: No module named 'gevent.pywsgi'; 'gevent' is not a package
Renaming the script solves the problem:
$ mv gevent.py myscript.py
$ python myscript.py
$
I have this same issue in Windows 10 professional x64, python 2.7.13
Running a basic test in OSX via CLI, (opening python interpreter in terminal, import gevent.pywsgi) did not throw any errors.
Are there any Unix/POSIX specific dependencies that you would expect may have a hard time in the windows environment?

Thanks,
When you say "this same issue" do you mean the same ImportError: ImportError: No module named 'gevent.pywsgi'; 'gevent' is not a package (or ImportError: No module named pywsgi on Python 2)? If so the probable cause is the same (a gevent.py somewhere on your sys.path).
There should be no Unix-specific dependencies. pywsgi is tested on Windows with the same test suite as other platforms.
Most helpful comment
If your script is named
gevent.py, you're going to have a conflict with thegevent_package_. Try naming your script something else.Python 3 produces a cleaner error message:
Renaming the script solves the problem: