Прошлось мне..
dedic:~/src $ ./configure –prefix=/home/dedic –datadir=/home/dedic ; make ; make install
dedic:~/src $ virtualenv /home/dedic
dedic:~/src $ . /home/dedic/bin/activate
(dedic) dedic:~/src $
выбрал веб-приложение для примера по этой ссылке
http://aiohttp.readthedocs.io/en/stable/web.html#user-sessions:import asyncio
import time
from aiohttp import web
from aiohttp_session import get_session, session_middleware
from aiohttp_session.cookie_storage import EncryptedCookieStorage
async def handler(request):
session = await get_session(request)
session['last_visit'] = time.time()
return web.Response(body=b'OK')
async def init(loop):
app = web.Application(middlewares=[session_middleware(
EncryptedCookieStorage(b'Sixteen byte key'))])
app.router.add_route('GET', '/', handler)
srv = await loop.create_server(
app.make_handler(), '0.0.0.0', 8080)
return srv
loop = asyncio.get_event_loop()
loop.run_until_complete(init(loop))
try:
loop.run_forever()
except KeyboardInterrupt:
pass
(dedic) dedic:~/src $ pip install aiohttp_session
вываливаются ошибки:
(dedic) dedic:~/aiohttp$ pip install aiohttp_session
Collecting aiohttp_session
/home/dedic/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning. SNIMissingWarning
/home/dedic/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning
Downloading aiohttp_session-0.5.0.tar.gz (91kB)
100% |████████████████████████████████| 92kB 3.1MB/s
Collecting aiohttp>=0.18 (from aiohttp_session)
Using cached aiohttp-0.21.6.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “<string>”, line 1, in <module>
File “/tmp/pip-build-NqorfJ/dedic/setup.py”, line 61, in <module>
raise RuntimeError(“aiohttp requires Python 3.4.1+”)
RuntimeError: aiohttp requires Python 3.4.1+
—————————————-
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-NqorfJ/dedic/
(dedic) dedic: ~/dedic$ ./sio.py
Traceback (most recent call last):
File “./sio.py”, line 6, in <module>
from aiohttp_session import get_session, session_middleware
ImportError: No module named ‘aiohttp_session’
Вопрос почему подхватывает
python2.7?