当我运行.exe
时,它在控制台输出中生成以下内容:
C:Python27Scriptsdist>SNAPpy279.exe
Traceback (most recent call last): File "<string>", line 26, in <module> File "C:Python27Libsite-packagesPyInstallerloaderpyi_importers.py", line 270, in load_module exec(bytecode, module.__dict__) File "C:Python27ScriptsbuildSNAPpy279out00-PYZ.pyzstatsmodels.api", line 19, in <module> File "C:Python27Libsite-packagesPyInstallerloaderpyi_importers.py", line 270, in load_module exec(bytecode, module.__dict__) File "C:Python27ScriptsbuildSNAPpy279out00-PYZ.pyzstatsmodels.__init__", line 8, in <module> ImportError: No module named tools.sm_exceptions
有可能简单的解决方案吗?建议吗?
UPDATE:再次遇到此问题,我的修复不工作。为了解决这个问题,我改变了
一行from .tools.sm_exceptions import (ConvergenceWarning, CacheWriteWarning,
IterationLimitWarning, InvalidTestWarning)
在 statmodels __init__.py第8行中:from statsmodels.tools.sm_exceptions import (ConvergenceWarning, CacheWriteWarning,
IterationLimitWarning, InvalidTestWarning)
我想我上周在同一期上过。在我的例子中,我通过添加
来修复它import statsmodels.api
在我的主脚本。