PyInstaller:导入geopandas时出现StopIteration错误

哈哈

我试图PyInstaller在我的脚本上执行我安装了所有必需的软件包,并且.exe创建成功。

但是,当我在另一台机器上执行它时,我得到他以下错误:

[2837] LOADER: Running pyi_rth_glib.py
[2837] LOADER: Running pyi_rth_pkgres.py
[2837] LOADER: Running pyi_rth_multiprocessing.py
[2837] LOADER: Running physiocap_templatized.py
Traceback (most recent call last):
  File "physiocap_templatized.py", line 53, in <module>
  File "/usr/lib/python2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "geopandas/__init__.py", line 9, in <module>
  File "/usr/lib/python2.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 395, in load_module
  File "geopandas/datasets/__init__.py", line 7, in <module>
StopIteration
[2837] Failed to execute script physiocap_templatized
[2837] LOADER: OK.
[2837] LOADER: Cleaning up Python interpreter.
[2836] LOADER: Restoring signal handlers
[2836] LOADER: freeing args
[2836] LOADER: returning child exit status 255
[2836] LOADER: Back to parent (RC: 255)
[2836] LOADER: Doing cleanup
[2836] LOADER: Freeing archive status for /root/MyExe/physiocap_AB_templatized

我试过了,但没有帮助。这是我在执行PyInstaller以下命令的计算机上安装的软件包的列表pip freeze

aenum==2.1.2
altgraph==0.16.1
asn1crypto==0.24.0
astroid==1.6.6
attrs==19.1.0
backports.functools-lru-cache==1.5
backports.ssl-match-hostname==3.5.0.1
cffi==1.12.3
Click==7.0
click-plugins==1.1.1
cligj==0.5.0
configobj==4.7.2
configparser==3.7.4
configshell-fb==1.1.23
contextlib2==0.5.5
coverage==3.6b3
cryptography==2.7
cycler==0.10.0
Cython==0.29.10
decorator==3.4.0
descartes==1.1.0
di==0.0.1
dis3==0.1.2
dnspython==1.12.0
enum==0.4.7
enum34==1.1.6
ez-setup==0.9
Fiona==1.7.11.post1
future==0.17.1
futures==3.1.1
GDAL==1.11.4
geopandas==0.3.0
geopy==1.12.0
idna==2.8
iniparse==0.4
ipaddress==1.0.16
IPy==1.0
Jinja2==2.10.1
jwcrypto==0.2.1
kitchen==1.1.1
kiwisolver==1.0.1
langtable==0.0.45
lazy-object-proxy==1.4.1
macholib==1.11
MarkupSafe==1.1.1
matplotlib==2.2.4
mplleaflet==0.0.5
munch==2.3.2
nose==1.3.7
numpy==1.12.0
pandas==0.22.0
pefile==2019.4.18
perf==0.1
pyasn1==0.4.5
pyasn1-modules==0.2.5
pycparser==2.19
pycurl==7.19.0
pygobject==3.22.0
pygpgme==0.3
PyInstaller==3.4
pyliblzma==0.5.3
pyparsing==2.4.0
pyproj==1.9.5.1
pyshp==2.1.0
python-augeas==0.5.0
python-dateutil==2.8.0
python-linux-procfs==0.4.9
pytz==2019.1
pyudev==0.15
pyxattr==0.5.1
schedutils==0.4
schema==0.7.0
scikit-learn==0.19.1
scipy==0.16.0
Shapely==1.6.4.post2
simplekml==1.3.1
singledispatch==3.4.0.3
six==1.12.0
slip==0.4.0
slip.dbus==0.4.0
subprocess32==3.5.4
urlgrabber==3.10
wrapt==1.11.2
yum-metadata-parser==1.1.4

我在Centos7一起使用机器Python2.7.5PyInstaller3.4

谢谢。

托德·埃蒙

您是否尝试过此答案的解决方案?

我没有在项目中使用geopandas数据集,因此,我只是注释掉了import geopandas.datasets来自声明,而不是将它们手动添加到.spec文件中File "site-packages\geopandas\__init__.py", line 9, in <module>

这对我来说很有用-我确实停止了此Stop Iteration错误。相反,我遇到了另一个错误(在我的情况下,这是CRS错误),但是这个错误似乎更容易解决。

无论如何,pyinstaller和链接到其依赖项(pyproj,fiona ...)的geopandas之间肯定存在兼容性问题,所以我认为如果遇到更多错误,也值得分别检查每个模块的导入。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章