jaseg / python-mpv

Python interface to the awesome mpv media player
https://git.jaseg.de/python-mpv.git
Other
550 stars 68 forks source link

I do not literally know which DLLs does it need to consume #268

Closed MajliTech closed 8 months ago

MajliTech commented 10 months ago

Hello, I'm trying to run mpv with Python from a embeded package. However, after putting in every DLL I could find on the internet i got this error:

Traceback (most recent call last):
File "Z:\test-suite.py”, line 10, in <module>
import mpv
File "Z:\mpv.py”, line 45, in <module>
backend = CDLL(dl1)
File "ctypes\_init_ .py", line 374, in init __
OSError: (WinError 193] %1 is not a valid Win32 application

What could be wrong here? I have the following files:

jaseg commented 10 months ago

I'm not sure what happened here. You stack trace looks all weird, and the line backend = CDLL(dl1) does not actually appear anywhere in mpv.py (notice the dl1 with a number one instead of dll).

Some quick googling tells me that Windows apparently throws this error when you try to load a DLL file that doesn't actually contain a DLL. Do you have a file named mpv-1.dll or mpv-2.dll that isn't a DLL?

mpv.py looks for a DLL named mpv-2.dll. If your libmpv download has it named libmpv-2.dll, you can just rename that file to mpv-2.dll. Make sure that the file is in your system's library search path (e.g. in the same folder next to your python interpreter). Here's a site that distributes Windows libmpv builds: link

jaseg commented 8 months ago

I'm closing this because it looks like this was probably an issue of your particular installation, not of python-mpv. Please feel free to open another issue if you continue having this problem and my reply above doesn't help.