Python code error: No module named 'aiohttp'
Hi All,
i tried to run python code in dataiku to collect data from API, but i got error: No module named 'aiohttp'
i tried to install aiohttp in my computer, it was successful installed, but i still got same error while running code again.
i would like to ask that how to install aiohttp library in dataiku? or how to fix the error?
Thanks in advance!
Ngoc
Best Answer
-
You need to install that package in a code environment:
https://doc.dataiku.com/dss/latest/code-envs/index.html
And then use that code environment in the Python recipe/notebook.
Answers
-
Thanks a lot JuanE, that's helped me.
But i got another error like this, can you give me advise on this:
Job failed: Error in Python process: At line 77: <class 'TypeError'>: __init__() got an unexpected keyword argument 'session'
a piece of my code:
c_session = aiohttp.ClientSession()
loop = asyncio.get_event_loop()
data_ISAT = loop.run_until_complete(set_wbsnn_df(ISAT_halaman,ISAT_kaLink,ISAT_args,c_session))
data_ISAT = data_ISAT.fillna('')thanks in advance
Ngoc
-
That just means there is an error in the Python code you're writing. As the error says, in line 77 you're initializing a class by passing it a "session" keyword argument, but it was not expecting it. You will have to read the documentation of whatever library you're using to know more.
-
thanks bro, i solved it.