Problem with loading win32file.pyd on python 2.6

前端 未结 1 556
再見小時候
再見小時候 2021-02-06 09:38

I can\'t make py2exe to pack correctly even a simple script that uses win32file I\'m constantly getting the following error message:

Traceback (most recent call          


        
相关标签:
1条回答
  • 2021-02-06 10:02

    The soution was to remove MSWSOCK.dll that was copied to the dist directory by py2exe incorrectly.

    I've used procmon and listdll to check what is loaded by win32file.pyd when import is successfull and what dll are loaded when import fails. Then having the list of dlls I've checked if they are loaded correctly ie. python dlls from dist folder and windows dlls from windows folder.

    Here is the setup.py that works fine

    from distutils.core import setup
    import py2exe
    setup(console=['dependency_checker.py'],
         options={'py2exe': {"dll_excludes": ["mswsock.dll", "MSWSOCK.dll"]}}
         )
    
    0 讨论(0)
提交回复
热议问题