0

My script file test.py is:

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

My setup.py file is:

from distutils.core import setup
import py2exe

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

I then run:

python setup.py py2exe

If I then launch test.exe on my pc I see no issues but if I copy it to a new pc with no prior python installs I get:

[Error 126] The specified module could not be found

I don't know how to get the full traceback to print. Has anyone else seen this issue? Running Python 2.7, PyVisa 1.4. Both machines are Win7.

Jonno
  • 767
  • 2
  • 7
  • 13
  • When I say, "copy it" I of course mean copy the entire dist folder to the new pc and then launch test.exe – Jonno Aug 28 '12 at 15:47
  • When I originally saw this issue in my windows app the full traceback ended with something like: File "C:\Python27\Lib\ctypes\__init__.py", line 340, in __init__ – Jonno Aug 28 '12 at 15:59
  • `Traceback (most recent call last): File "test.py", line 2, in File "visa.pyo", line 1, in File "pyvisa\visa.pyo", line 231, in File "pyvisa\vpp43.pyo", line 105, in __new__ File "pyvisa\visa.pyo", line 227, in init File "pyvisa\vpp43.pyo", line 758, in open_default_resource_manager File "pyvisa\vpp43.pyo", line 175, in __call__ File "pyvisa\vpp43.pyo", line 141, in load_library File "ctypes\__init__.pyo", line 423, in __getattr__ File "ctypes\__init__.pyo", line 353, in __init__ WindowsError: [Error 126] The specified module could not be found` – Jonno Aug 28 '12 at 20:29

1 Answers1

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.

Jonno
  • 767
  • 2
  • 7
  • 13