windows python 3.5.1 aiohttp 0.22.5 ImportError: No module named 'aiohttp.multidict'

1,357 views
Skip to first unread message

dziz...@gmail.com

unread,
Aug 7, 2016, 9:56:59 AM8/7/16
to aio-libs
Hi!

I'm experiencing on Windows python 3.5.1 aiohttp 0.22.5 the following:

ImportError: No module named 'aiohttp.multidict'

does anyone knows how to solve it?

Thanks!

Andrew Svetlov

unread,
Aug 7, 2016, 10:20:59 AM8/7/16
to dziz...@gmail.com, aio-libs
Did you install the library by `pip install aiohttp` ??
aiohttp has `multidict` as dependency (as well as chardet).
aiohttp==0.22.5 depends from multidict==1.2.2
All dependencies should be installed automatically by pip tool.

--
You received this message because you are subscribed to the Google Groups "aio-libs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aio-libs+u...@googlegroups.com.
To post to this group, send email to aio-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aio-libs/7feb28ed-20e2-41c5-b86f-582fae9c115f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Thanks,
Andrew Svetlov

dziz...@gmail.com

unread,
Aug 7, 2016, 10:24:13 AM8/7/16
to aio-libs, dziz...@gmail.com
Hi!

Yes, all installed using pip:

Please see attachement.
Capture.PNG

Andrew Svetlov

unread,
Aug 7, 2016, 10:30:17 AM8/7/16
to aio-libs, dziz...@gmail.com
If you have multidict==1.2.2 installed everything should work fine.

Please try the following inside an interactive shell:

>>> import multidict
>>> import aiohtp
>>> import aiohttp.multidict

dziz...@gmail.com

unread,
Aug 7, 2016, 10:42:07 AM8/7/16
to aio-libs, dziz...@gmail.com
Python 3.5.1 (v3.5.1:37a07cee5969, Dec  6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> import multidict
>>> import aiohttp
>>> import aiorest
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\dev\aioenv\lib\site-packages\aiorest\__init__.py", line 37, in <module>
    from .server import RESTServer
  File "c:\dev\aioenv\lib\site-packages\aiorest\server.py", line 9, in <module>
    from .handler import RESTRequestHandler
  File "c:\dev\aioenv\lib\site-packages\aiorest\handler.py", line 9, in <module>
    from .request import Request
  File "c:\dev\aioenv\lib\site-packages\aiorest\request.py", line 7, in <module>
    from aiohttp.multidict import MultiDict, CIMultiDict, MultiDictProxy
ImportError: No module named 'aiohttp.multidict'



Andrew Svetlov

unread,
Aug 7, 2016, 11:20:46 AM8/7/16
to aio-libs, dziz...@gmail.com
Finally got your problem.
`aiorest` project is abandoned, README explicitly states this.
All aiorest functionality (and even much more) is supported by aiohttp itself.

Please just never try to install aiorest -- it literally doesn't work

dzizes

unread,
Aug 7, 2016, 11:33:04 AM8/7/16
to Andrew Svetlov, aio-libs
Andrew,

Thanks for the tip! Do you by chance have a good aiohttp server example which servers json's as a result of postgres queries?

Cheers!

---
Explicit is better than implicit.

Andrew Svetlov

unread,
Aug 7, 2016, 11:50:11 AM8/7/16
to aio-libs, andrew....@gmail.com


On Sunday, August 7, 2016 at 6:33:04 PM UTC+3, dzizes wrote:
Do you by chance have a good aiohttp server example which servers json's as a result of postgres queries?

Not yet.
 
But it's really trivial: use `request.json()` for parsing incoming data and json_response()  http://aiohttp.readthedocs.io/en/stable/web_reference.html#json-response for sending results back.

If you want to contribute into aiohttp documentation -- you are welcome!

dziz...@gmail.com

unread,
Aug 8, 2016, 4:08:33 AM8/8/16
to aio-libs, andrew....@gmail.com

Andrew Svetlov

unread,
Aug 8, 2016, 5:51:41 AM8/8/16
to dziz...@gmail.com, aio-libs
Recreation of Postgres and Mongo clients for every requests is not ok

Try https://github.com/KeepSafe/aiohttp/tree/master/demos/polls
--
Thanks,
Andrew Svetlov
Reply all
Reply to author
Forward
0 new messages