Pyinstaller - WindowsError: [Error 126] The specified module could not be found

巧了我就是萌 提交于 2019-12-06 15:26:20

The problem was the geos_c.dll file. Pyinstaller was not picking it up automatically. I tried copying this to the build directory where the spec file was being executed from. This wasn't enough however and the solution was to edit the spec file to include the geos_c.dll

# -*- mode: python -*-
a = Analysis(['GIS_Helper.py'],
             pathex=['C:\\Users\\Hp\\PycharmProjects\\GISdev'],
             hiddenimports=['scipy.linalg.cython_blas', 'scipy.linalg.cython_lapack', 'scipy.special._ufuncs_cxx', 'multiprocessing', '_multiprocessing', 'multiprocessing.process', 'multiprocessing.util', 'ctypes.util', 'pandas.util', 'distutils.util', 'shapely'],
             hookspath=None,
             runtime_hooks=None)



a.binaries=['geos_c.dll', 'geos_c.dll', 'BINARY'],

pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts,
          [('v',None,'OPTION')],
          a.binaries,
          a.zipfiles,
          a.datas,
          name='GIS_Helper.exe',
          debug=True,
          strip=None,
          upx=True,
          console=True )
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!