Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't work with 64 bit python on windows (only 32 bit libdiscid dll) #73

Closed
JonnyJD opened this issue Oct 2, 2013 · 8 comments · Fixed by #127
Closed

doesn't work with 64 bit python on windows (only 32 bit libdiscid dll) #73

JonnyJD opened this issue Oct 2, 2013 · 8 comments · Fixed by #127

Comments

@JonnyJD
Copy link
Owner

JonnyJD commented Oct 2, 2013

Using 64 bit Python 3 on (64 bit) Windows 8:

    G:\isrcsubmit-2.0.0-beta.4-win32>isrcsubmit.bat
    Traceback (most recent call last):
      File "G:\isrcsubmit-2.0.0-beta.4-win32\discid\libdiscid.py", line 93, in _open_library
        return ctypes.cdll.LoadLibrary(lib_name)
      File "C:\Python33\lib\ctypes\__init__.py", line 431, in LoadLibrary
        return self._dlltype(name)
      File "C:\Python33\lib\ctypes\__init__.py", line 353, in __init__
        self._handle = _dlopen(self._name, mode)
    OSError: [WinError 193] %1 ist keine zulässige Win32-Anwendung


    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "G:\isrcsubmit-2.0.0-beta.4-win32\isrcsubmit.py", line 41, in <module>
        import discid
      File "G:\isrcsubmit-2.0.0-beta.4-win32\discid\__init__.py", line 30, in <module>
        from discid.disc import read, put, Disc, DiscError, TOCError
      File "G:\isrcsubmit-2.0.0-beta.4-win32\discid\disc.py", line 23, in <module>
        from discid.libdiscid import _LIB, FEATURES
      File "G:\isrcsubmit-2.0.0-beta.4-win32\discid\libdiscid.py", line 102, in <module>
        _LIB = _open_library(_LIB_NAME)
      File "G:\isrcsubmit-2.0.0-beta.4-win32\discid\libdiscid.py", line 97, in _open_library
        raise OSError("could not find libdiscid: %s" % lib_name)
    OSError: could not find libdiscid: discid.dll

    Drücken Sie eine beliebige Taste . . .

Removing 64 bit Python and installing Python 3.3 works (after fixing #71).

Reported by Stalker-X on IRC.

@JonnyJD
Copy link
Owner Author

JonnyJD commented Oct 9, 2013

I did a bit of reading and it looks like even when using ctypes, this is all in one process. So the problem is that a 64 bit Python can't use a 32 bit DLL. This is the same on all platforms, but on Linux there are no binary builds of libdiscid (distributions compile for the needed architecture) and on Mac there are universal binaries (ppa, intel32, intel64).
metabrainz/libdiscid#31 is about doing 64 bit builds on Windows. I don't have a 64 bit Windows machine available for building.

@jesus2099
Copy link
Contributor

Hello @JonnyJD, I am under Windows 7 64 bits and I don't have any errors.
Although I can't really go until the end of the script*, I can tell that I don’t have any 32 bit errors.

* I am stuck at « ERROR: Invalid credentials: caused by: HTTP Error 401: Unauthorized » but it may be due to my Firewall (#114).

@jesus2099
Copy link
Contributor

@JonnyJD I will use your script again now.
I solved my 401 error by removing my proxy settings from dos (set http_proxy=).
If you need some info about this issue, please ask me. :)

@jesus2099
Copy link
Contributor

Hello @JonnyJD now I realise my mistake.
I am onw on Windows 10 64 bits and I do have error because I have Pyhton 64 bits installed.
I could help you to do some build or something #73 (comment) if you tell me how.

@jesus2099
Copy link
Contributor

jesus2099 commented Aug 24, 2019

I downloaded 64 bit discid.dll from https://ci.appveyor.com/project/MetaBrainz/libdiscid/build/artifacts and overwritten the file and it's working OK!

@Freso
Copy link
Collaborator

Freso commented May 7, 2021

I’m thinking to drop (shipped) 32-bit support starting from 3.x. Several Linux distributions have dropped/are dropping 32-bit support. Microsoft stopped supporting new 32-bit installs last summer (though still supporting existing ones). For systems where you make the program yourself, this should be a non-issue since Python doesn’t care, but it will be slightly less complexity for me as maintainer. Esp. for platforms I don’t have access to.

I’ll try and see if there’s an easy fix for 2.1.1 (thanks for PR @jesus2099!), and if so, 2.1.1 will have both 32-bit and 64-bit support… and will probably be the last official build version to be shipped with 32-bit support.

@Freso Freso added this to the 2.1.1 milestone May 7, 2021
@jesus2099
Copy link
Contributor

jesus2099 commented Sep 27, 2022

My laptop has been re-installed and I cannot use this any more.
I re-installed Python 3 (64 bits apparently).

Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] on win32

I don't remember how to fix it:

C:\Users\bob\Documents\PRG\isrcsubmit-2.1.0-win32>isrcsubmit.bat
Traceback (most recent call last):
  File "C:\Users\bob\Documents\PRG\isrcsubmit-2.1.0-win32\isrcsubmit.py", line 47, in <module>
    import discid
  File "C:\Users\bob\Documents\PRG\isrcsubmit-2.1.0-win32\discid\__init__.py", line 30, in <module>
    from discid.disc import read, put, Disc, DiscError, TOCError
  File "C:\Users\bob\Documents\PRG\isrcsubmit-2.1.0-win32\discid\disc.py", line 24, in <module>
    from discid.libdiscid import _LIB, FEATURES
  File "C:\Users\bob\Documents\PRG\isrcsubmit-2.1.0-win32\discid\libdiscid.py", line 108, in <module>
    _LIB = _open_library(_LIB_NAME)
  File "C:\Users\bob\Documents\PRG\isrcsubmit-2.1.0-win32\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.

Update: this is fixed with #144

@Freso Freso closed this as completed in 8f91e92 Dec 7, 2022
Freso pushed a commit that referenced this issue Dec 7, 2022
@jesus2099
Copy link
Contributor

jesus2099 commented Aug 9, 2023

I am now on a new Windows 10 Pro and if I don't manually replace discid.dll with the 64 bit version, I still get this error:

Traceback (most recent call last):
  File "C:\Users\bob\AppData\Local\Programs\isrcsubmit-2.1.0-win32\discid\libdiscid.py", line 99, in _open_library
    return ctypes.cdll.LoadLibrary(lib_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\ctypes\__init__.py", line 454, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\ctypes\__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 193] %1 n’est pas une application Win32 valide

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\bob\AppData\Local\Programs\isrcsubmit-2.1.0-win32\isrcsubmit.py", line 53, in <module>
    import discid
  File "C:\Users\bob\AppData\Local\Programs\isrcsubmit-2.1.0-win32\discid\__init__.py", line 30, in <module>
    from discid.disc import read, put, Disc, DiscError, TOCError
  File "C:\Users\bob\AppData\Local\Programs\isrcsubmit-2.1.0-win32\discid\disc.py", line 24, in <module>
    from discid.libdiscid import _LIB, FEATURES
  File "C:\Users\bob\AppData\Local\Programs\isrcsubmit-2.1.0-win32\discid\libdiscid.py", line 108, in <module>
    _LIB = _open_library(_LIB_NAME)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\bob\AppData\Local\Programs\isrcsubmit-2.1.0-win32\discid\libdiscid.py", line 103, in _open_library
    raise OSError("could not find libdiscid: %s" % lib_name)
OSError: could not find libdiscid: discid.dll

This PR #127 is merged but the downloadable zip are still the same old ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants