After installing VISA and PyVisa, VISA module is not found

Crystal picture Crystal · Sep 25, 2013 · Viewed 9.7k times · Source

I'm on Mac OS X v10.8.5 (Mountain Lion). I've installed NI-VISA 5.4 and PyVisa 1.5. When I try 'import visa', I get this traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named visa

Printing the sys.path shows this in the listing:

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyVISA-1.5.dev0.dev-py2.7.egg

I have also tried this:

import pyvisa
from pyvisa.vpp43 import visa_library
visa_library.load_library("/Library/Frameworks/VISA.framework/VISA")
import visa

But I get the same error.

Why can't the module be found? What am I missing?

UPDATE: I realized that PyVisa 1.5 was a development build, so I installed PyVisa 1.4 instead (I tried both MacPorts and just downloading the tarball and installing it manually). I'm still getting the same error.

Answer