kay-el-zed / HaloMCC-DiscordRPC

A python script that grabs your XBL status for Halo MCC and shows it as a Discord rich presence status.
12 stars 2 forks source link

Can't Import PyPresence #1

Closed Gurrman375 closed 4 years ago

Gurrman375 commented 4 years ago
Traceback (most recent call last):
  File "C:\Users\User\Desktop\HaloMCC-DiscordRPC-master\HaloMCC-DiscordRPC-master\Halo MCC Rich Presence\Halo_MCC_Rich_Presence.py", line 4, in <module>
    from pypresence import Presence, Activity
ImportError: cannot import name 'Activity' from 'pypresence' (C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\pypresence\__init__.py)

This is the error I get whenever running the script. I have pypresence in that location.

Gurrman375 commented 4 years ago

The fix for right now is to commit out Activity.

from xbox.webapi.authentication.manager import AuthenticationManager
from xbox.webapi.common.exceptions import AuthenticationException
from xbox.webapi.api.client import XboxLiveClient
from pypresence import Presence # Activity
kay-el-zed commented 4 years ago

Thanks for the report! The Activity class was removed from pypresence as of version 4.0. It also seems I forgot about removing the Activity import as it wasn't used at all.

Commit e82c802b225073eb9e961668b1757b1dda66c65e fixes this issue.