Python code error: No module named 'aiohttp'

engcngn Registered Posts: 3

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!



Best Answer


  • engcngn
    engcngn Registered Posts: 3

    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


  • JuanE
    JuanE Dataiker, Registered Posts: 45 Dataiker

    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.

  • engcngn
    engcngn Registered Posts: 3

    thanks bro, i solved it.

Setup Info
      Help me…