genialis / resolwe-bio-py

Resolwe Bioinformatics Python API
Apache License 2.0
4 stars 25 forks source link

Async download not working in Jupyter Notebook #244

Open robertcv opened 3 years ago

robertcv commented 3 years ago

Trying to download expression data with the new async functionality in a Jupyter Notebook results in the following error:

RuntimeError: This event loop is already running

From doing a bit of research it seems that the problem is that notebooks also use the async loop and the functionality can't be nested. The current workaround is to use the package nest_asyncio and add the following before downloading expressions:

import nest_asyncio
nest_asyncio.apply()

When time allowed we should probably look more into it and see if there is a permanent fix for this.

robertcv commented 3 years ago

Some reference: notebook issue 3397

JureZmrzlikar commented 3 years ago

Thanks for reporting. For now, I agree we can leave users to patch their notebooks with the nest_asyncio.apply(), but if this becomes painful enough, we can try to solve in ReSDK.

uksurd88 commented 2 years ago

Thanks @romunov for linking me here, I hit the same error today