wynick27 / steam-missing-covers-downloader

Adds missing library covers for new steam UI
Other
73 stars 14 forks source link

AttributeError: module 'asyncio' has no attribute 'run' #8

Closed PoorPocketsMcNewHold closed 5 years ago

PoorPocketsMcNewHold commented 5 years ago
pm@Velvet4Renaissance:~/steam-missing-covers-downloader$ python3 missing_cover_downloader.py 
Steam path: /home/pm/.steam/steam
SteamID: 150966242
Steam grid path: /home/pm/.steam/steam/userdata/150966242/config/grid
Total packages in library: 1075
Retriving package details
Loading packageinfo.vdf
Total packages in local cache 1075
Retriving apps in packages
Total apps in library: 1789
Retriving app details
Loading appinfo.vdf
Total apps in local cache 1825
Total games missing cover in library: 540
Total local covers found: 0
Total missing covers locally: 540
Finding covers from steamgriddb.com
Traceback (most recent call last):
  File "missing_cover_downloader.py", line 518, in <module>
    main()
  File "missing_cover_downloader.py", line 513, in main
    total_downloaded = asyncio.run(download_covers_temp(local_missing_cover_appids,steam_grid_path,missing_cover_app_dict))
AttributeError: module 'asyncio' has no attribute 'run'

Running on Python 3.5.3, from deepin 15.11 (Debian Linux based distribution) beautifulsoup4-4.8.0, aiohttp-3.6.1, the precised steam module from the ReadMe.md (Listed as 1.0.0a6) are installed on pip3. (Confirmed it by launching the pip module from Python3 itself sudo python3 -m pip install MODULENAME) Even tried installing asyncio-3.4.3 with no luck.

wynick27 commented 5 years ago

asyncio.run was added to python in 3.7, you can update to 3.7 or change asyncio.run to old style

loop = asyncio.get_event_loop()
loop.run_until_complete(download_covers_temp(local_missing_cover_appids,steam_grid_path,missing_cover_app_dict,loop))

then add loop as a parameter in download_covers_temp and replace asyncio.create_task with loop.create_task

PoorPocketsMcNewHold commented 5 years ago

Thanks for your answer, as 3.5.3 was the latest version available in my distro repos, and because any minimal version weren't precised, I've didn't blame the issue on my version of Python. I've built the latest version of Python, and the script seems now to run smoothly. A new issue however happen, But i'll open a new issue because it's seems more API related.