Pyinstaller - ImportError:在Linux中没有名为mtrand的模块

时间:2015-02-13 12:46:05

标签: python numpy executable pyinstaller

我正在尝试使用pyinstaller构建一个可执行文件,然后遇到某些未导入/导入的模块的问题。这是给出各种错误的最小代码。我能够解决前几个错误,但我仍然坚持当前的错误。

import numpy as np
def test_module():
    print "Test Starts"
    a=np.array([(1,4),(2,6),(3,9),(4,1)])
    print np.size(a)
    print np.shape(a)
    print "Test Ends"

test_module()

使用生成的默认spec文件,我收到错误“import multiarray failed”。 通过在.spec文件中的Analysis下的pathex中添加numpy路径,此错误得到修复。

现在我收到错误“ImportError:没有名为mtrand的模块”

但我在dist文件夹中有“random.mtrand.so”和“numpy.random.mtrand.so”。 我也试过从“/numpy/ramdom/mtrand.so”复制“mtrand.so” 我还通过在隐藏导入中给出'numpy','numpy.random'或'numpy.random.mtrand'进行检查。

我仍无法解决此问题。

0 个答案:

没有答案