且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 py2exe 进行 scipy

更新时间:2023-11-17 20:14:40

这似乎是 py2exe 和 pyinstaller 与 scipy 0.11.0 共同存在的问题,正如所讨论的 此处.

This seems to be a problem common to py2exe and pyinstaller with scipy 0.11.0 as discussed here.

该线程中给出的临时解决方案是手动导入文件:

The temporal solution given in that thread is to import the file manually:

将以下代码添加到您的程序中

adding the following codes into your program

def dependencies_for_myprogram():
    from scipy.sparse.csgraph import _validation

pyInstaller 和 py2exe 都解决了问题

Problem solved for both pyInstaller and py2exe

您也可以尝试使用includes"包含此文件.py2exe 获取它应该足够了.

You can alternatively try including this file with 'includes'. It should be enough for py2exe to get it.