Cannot import Geopandas with PyInstaller executable - despite running fine in the virtual env

前端 未结 2 1292
独厮守ぢ
独厮守ぢ 2021-01-06 17:52

When my Python application frozen with PyInstaller attempts to import Geopandas, it stops working.

  • Windows 10
  • PyInstaller 3.3.1
  • Geopandas 0.
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-06 18:46

    I received this same error and solved it differently to aorr above.

    The error was caused because the geopandas datasets included in the package aren't found by pyinstaller because they are .shp files.

    I don't use the geopandas datasets in my project/s so instead of manually including them in my .spec file I just commented out the import geopandas.datasets statement from: File "site-packages\geopandas\__init__.py", line 9, in .

    This compiled properly and gave me the expected outputs for my program.

提交回复
热议问题