0

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user3638330
  • 3
  • 1
  • 3
  • You can check what all attributes does the module object have by calling `dir(visa)`. Use this to make sure you are not making any typo. Also use this to check if the module object has the expected attributes. – vaidik May 20 '14 at 21:29
  • Using dir(visa), neither VisaLibrary, nor visa-library appear as attributes. Seems like a necessary attribute for core functionality though. – user3638330 May 20 '14 at 22:02

1 Answers1

1

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().

Davidmh
  • 3,797
  • 18
  • 35
  • Neither VisaLibrary, visa_library, nor test appear to be attributes of visa. I've tried a few installs, and haven't managed to access any of these attributes – user3638330 May 20 '14 at 22:03
  • So I got it running, and I think my biggest issue was using pyvisa 1.5 commands in pyvisa 1.4. Uninstalling 1.4, rebooting and installing 1.5 and the appropriate attributes are where they should be. Thanks – user3638330 May 20 '14 at 22:25