You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: class uri 'gaiohttp' invalid or not found:
[Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/gunicorn/util.py", line 139, in load_class
mod = import_module('.'.join(components))
File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2231, in _gcd_import
File "<frozen importlib._bootstrap>", line 2214, in _find_and_load
File "<frozen importlib._bootstrap>", line 2201, in _find_and_load_unlocked
ImportError: No module named 'gunicorn.workers.gaiohttp'
]
The contents of ex.py are
"""Basic http server with minimal setup"""
import aiohttp
import aiohttp.server
import asyncio
from urllib.parse import urlparse, parse_qsl
from aiohttp.multidict import MultiDict
class HttpRequestHandler(aiohttp.server.ServerHttpProtocol):
@asyncio.coroutine
def handle_request(self, message, payload):
response = aiohttp.Response(
self.writer, 200, http_version=message.version)
get_params = MultiDict(parse_qsl(urlparse(message.path).query))
if message.method == 'POST':
post_params = yield from payload.read()
else:
post_params = None
content = "<h1>It Works!</h1>"
if get_params:
content += "<h2>Get params</h2><p>" + str(get_params) + "</p>"
if post_params:
content += "<h2>Post params</h2><p>" + str(post_params) + "</p>"
bcontent = content.encode('utf-8')
response.add_header('Content-Type', 'text/html; charset=UTF-8')
response.add_header('Content-Length', str(len(bcontent)))
response.send_headers()
response.write(bcontent)
yield from response.write_eof()
The text was updated successfully, but these errors were encountered:
I am running the following command
and I am getting following exception
The contents of ex.py are
The text was updated successfully, but these errors were encountered: