Issues with pyinstaller and pyproj

前端 未结 3 1255
灰色年华
灰色年华 2020-12-18 07:29

I\'m trying to do an standalone application with pyinstaller. The executable has just build fine, but when I´m trying to do some operations with functions integrated on libr

3条回答
  •  渐次进展
    2020-12-18 08:00

    The problem is that when using pyproj with PyInstaller, pyproj can not find the data files that are in the library folder.

    The solution is to create a hook file, which will specify where the data files, so you can link them with our executable.

     hook-pyproj.py
    
     from PyInstaller.hooks.hookutils import collect_data_files
     datas = collect_data_files('pyproj')
    

    The hook file can be located on "hooks" folder on Pyinstaller installation or using the order --additional-hooks-dir, specifying a folder in which will be located "hook-pyproj.py"

提交回复
热议问题