#!/usr/bin/env python3
import logging; logging.basicConfig(level=logging.INFO)
import asyncio, os, json, time
from datetime import datetime
from aiohttp import web
def index(request):
return web.Response(body=b'<h1>Awesome</h1>')
@asyncio.coroutine
def init(loop):
app = web.Application(loop=loop)
app.router.add_route('GET', '/', index)
srv = yield from loop.create_server(app.make_handler(), '127.0.0.1', 9000)
logging.info('server started at http://127.0.0.1:9000...')
return srv
loop = asyncio.get_event_loop()
loop.run_until_complete(init(loop))
loop.run_forever()
Process (28411) start... I (28411) just created a child process (28412). I am child process (28412) and my parent is 28411. Traceback (most recent call last): File "webApp.py", line 5, in import asyncio, os, json, time File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/asyncio/init.py", line 21, in Traceback (most recent call last): File "webApp.py", line 5, in import asyncio, os, json, time File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/asyncio/init.py", line 21, in from .base_events import * File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/asyncio/base_events.py", line 18, in from .base_events import * File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/asyncio/base_events.py", line 18, in import concurrent.futures File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/concurrent/futures/init.py", line 17, in import concurrent.futures File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/concurrent/futures/init.py", line 17, in from concurrent.futures.process import ProcessPoolExecutor File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/concurrent/futures/process.py", line 54, in from concurrent.futures.process import ProcessPoolExecutor File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/concurrent/futures/process.py", line 54, in from multiprocessing import SimpleQueue from multiprocessing import SimpleQueue ImportError: cannot import name 'SimpleQueue' ImportError: cannot import name 'SimpleQueue'
python3 -c "from multiprocessing import SimpleQueue"
for instance ? – Patrick