Search code examples
pythonvisa

Issue importing PyVISA


On Windows 8, Python 2.7, and PyVISA 1.4:

I have tried multiple installs, most recently using easy_install. When I enter import visa, it seems to work, and I do not get an error message.

When I try to run 'lib = visa.VisaLibrary()', I get the following error returned:

>>> lib = visa.VisaLibrary()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'VisaLibrary'
>>> 

I clearly have some functionality, as the resource manager exists:

>>> rm = visa.ResourceManager()
>>> print(rm)
ResourceManager()

So, why does it seem like I do not have access to all VISA functionality?


Solution

  • VisaLibrary is a function introduced in version 1.5. For 1.4, you have visa_library.

    To make sure everything is correct, you could run the tests; usually pyvisa.test().