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
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"]}}
)