You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When installing version 0.2.2 via pip install fundus crawling anything runs into an RuntimeError: There is already an event loop running. This can be resolved by installing it manually from git like: pip install -e git+https://github.com/flairNLP/fundus.git@ff54845f204d74c3572311ca030ddd0a93df09b6#egg=fundus
How to reproduce
fromfundusimportPublisherCollection, Crawler# initialize the crawler for Washington Timescrawler=Crawler(PublisherCollection.us.WashingtonTimes)
# crawl 2 articles and printforarticleincrawler.crawl(max_articles=1): # print article overviewprint(article)
# print only the titleprint(article.title)
Expected behavior.
Fundus-Article:
Title: "Donald Trump cancels North Carolina rally because of weather"
Text: "WILMINGTON, N.C. (AP) — Donald Trump had to cancel his first planned rally
Saturday since the start of his criminal hush money trial [...]"
From: The Washington Times (2024-04-20 19:49)
Donald Trump cancels North Carolina rally because of weather
Fundus-Article:
Title: "Conservatives dangle threat of ousting Speaker Johnson after foreign aid vote"
Text: "House Speaker Mike Johnson’s job appeared to be safe for the immediate future
after ushering through a foreign aid package Saturday, but a few [...]"
It seems that you're using Fundus in an async context. Most likely google colab? If not please let me know and I further investigate the issue. Fundus 0.2.2 utilizes asyncio and won't work in an already running event loop using crawl due to the limitations of asyncio. We recently #357 got rid of Fundus' async logic, but a new release is yet to come. You can either checkout the latest master branch (as you already mentioned :) ) or utilize Fundus' async interface (see also #344):
Thanks @MaxDall! I was working out of a notebook in VS Code. I reported it because it took me too much time to figure out why the exact same code was running in one project but not in the other to figure out that it was the installed version on pypi. Can assume others might ran into the same problem. Thanks for reacting so quickly. I will check out the new version shortly.
PS: I tried crawl_async under 0.2.2 and it ran into issues as well.
Describe the bug
When installing version 0.2.2 via
pip install fundus
crawling anything runs into anRuntimeError: There is already an event loop running
. This can be resolved by installing it manually from git like:pip install -e git+https://github.com/flairNLP/fundus.git@ff54845f204d74c3572311ca030ddd0a93df09b6#egg=fundus
How to reproduce
Expected behavior.
Fundus-Article:
Saturday since the start of his criminal hush money trial [...]"
Donald Trump cancels North Carolina rally because of weather
Fundus-Article:
after ushering through a foreign aid package Saturday, but a few [...]"
Conservatives dangle threat of ousting Speaker Johnson after foreign aid vote
Logs and Stack traces
Screenshots
No response
Additional Context
No response
Environment
The text was updated successfully, but these errors were encountered: