JonnyJD / musicbrainz-isrcsubmit

script to submit ISRCs from disc to musicbrainz
http://jonnyjd.github.io/musicbrainz-isrcsubmit/
GNU General Public License v3.0
40 stars 13 forks source link

Windows: Could not find module 'discid.dll' #143

Open jesus2099 opened 1 year ago

jesus2099 commented 1 year ago

Now that my laptop has been completely reset, it does not work. Maybe last time, it worked thanks to pre-existing stuff.

Now I get this error:

C:\Users\bob\Documents\PRG\DOS\isrcsubmit-2.1.1-beta-win64>isrcsubmit.bat
Traceback (most recent call last):
  File "C:\Users\bob\Documents\PRG\DOS\isrcsubmit-2.1.1-beta-win64\isrcsubmit.py", line 47, in <module>
    import discid
  File "C:\Users\bob\Documents\PRG\DOS\isrcsubmit-2.1.1-beta-win64\discid\__init__.py", line 30, in <module>
    from discid.disc import read, put, Disc, DiscError, TOCError
  File "C:\Users\bob\Documents\PRG\DOS\isrcsubmit-2.1.1-beta-win64\discid\disc.py", line 24, in <module>
    from discid.libdiscid import _LIB, FEATURES
  File "C:\Users\bob\Documents\PRG\DOS\isrcsubmit-2.1.1-beta-win64\discid\libdiscid.py", line 108, in <module>
    _LIB = _open_library(_LIB_NAME)
  File "C:\Users\bob\Documents\PRG\DOS\isrcsubmit-2.1.1-beta-win64\discid\libdiscid.py", line 99, in _open_library
    return ctypes.cdll.LoadLibrary(lib_name)
  File "C:\Users\bob\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\bob\AppData\Local\Programs\Python\Python310\lib\ctypes\__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'discid.dll' (or one of its dependencies). Try using the full path with constructor syntax.

Although there is a discid.dll file in the isrcsubmit-2.1.1-beta-win64 folder.

My new PR #144, based on @omgitsraven, would fix this ticket without breaking other OS and older Python.

jesus2099 commented 1 year ago

Oh this patch from @omgitsraven does work:

os.add_dll_directory(os.getcwd())

Same issue #124 with PR #125. Indeed I am now in Python 3.10.7 and this PR was supposed to work for Python 3.8+!

This PR was problematic for Pyhton 3.7-.