cniw / mpv-discordRPC

Discord Rich Presence integration for mpv Media Player
MIT License
133 stars 10 forks source link

ImportError: No module named pypresence #6

Closed GNULain closed 4 years ago

GNULain commented 4 years ago

Hello, I am trying to use this on a fresh install of Kubuntu 19.10 but for some reason pypresence is giving me issues. When running mpv from the terminal, I can see the script is giving this error over and over: Traceback (most recent call last): File "/home/user/.config/mpv/scripts/mpv-discordRPC/python-pypresence.py", line 6, in <module> import pypresence ImportError: No module named pypresence However, pypresence IS installed. Python 3 is at version 3.7.5. and pip3 list shows pypresence 3.3.2 is there. Further, if I open a terminal and manually run python3 and then import pypresence, it works just fine.

cniw commented 4 years ago

FYI python 2 will faces official end-of-life in 2020. So you got that error because Ubuntu derivative also still use python 2 as default. But currently in master branch i was change it at this commit, i asume that default python command is referring to python3.

To fix your issue you can change back file ~/.config/mpv/scripts/mpv-discordRPC.lua at line 233 and 236 from python to python3 like before.

GNULain commented 4 years ago

Thanks, that did seem to solve that problem and I'm not seeing any more error messages in the terminal, however it's still not working properly... the "playing mpv Media Player" status on Discord cycles on and off seemingly at random, but it never stays for more than 10 seconds or so while playing a video. Edit: It also seems like the status is stuck on the first file I opened in mpv... "fileA.mkv" is still being displayed even though I am now watching "fileB.mkv".

GNULain commented 4 years ago

I switched back to Debian stable and it seems to be doing the same thing on this as well. However, I noticed that while running mpv, the pypresence script seemingly keeps executing over and over again which might be what is causing this issue (See here). As you can see, mpv isn't even running anymore, but these processes aren't stopping. Since there are no actual errors in the log though, I can't really give any more insight into this, so I will close the issue.