0

我的脚本文件 test.py 是:

try:
    from visa import *
except Exception as ex:
    print ex
    raw_input()

我的 setup.py 文件是:

from distutils.core import setup
import py2exe

setup(console=['test.py'])

然后我运行:

python setup.py py2exe

如果我然后在我的电脑上启动 test.exe,我看不到任何问题,但如果我将它复制到没有先前安装 python 的新电脑,我会得到:

[错误 126] 找不到指定的模块

我不知道如何打印完整的回溯。有没有其他人看到这个问题?运行 Python 2.7、PyVisa 1.4。两台机器都是Win7。

4

1 回答 1

1

Turns out the problem was that the visa libraries that pyvisa relies on weren't installed on the test pc. These libraries don't come included with pyvisa.

于 2012-08-30T21:05:47.903 回答