pyvisa / pyvisa-sim

A PyVISA backend that simulates a large part of the "Virtual Instrument Software Architecture" (VISA_)
https://pyvisa-sim.readthedocs.io/en/latest/
MIT License
70 stars 39 forks source link

First attempt to create ResourceManager fails #1

Closed MatthieuDartiailh closed 9 years ago

MatthieuDartiailh commented 9 years ago

Doing this fails :

>>> import pyvisa
>>> pyvisa.ResourceManager('@sim')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\takis\Desktop\Madar\Anaconda\lib\site-packages\pyvisa\highlevel.py", line 1477, in __new__
    visa_library = open_visa_library(visa_library)
  File "C:\Users\takis\Desktop\Madar\Anaconda\lib\site-packages\pyvisa\highlevel.py", line 1449, in open_visa_library
    return cls(argument)
  File "C:\Users\takis\Desktop\Madar\Anaconda\lib\site-packages\pyvisa\highlevel.py", line 95, in __new__
    raise OSError('Could not open VISA library:\n' + '\n'.join(errs))
OSError: Could not open VISA library:
While opening u
[Errno 2] No such file or directory: u'u'
While opening n
[Errno 2] No such file or directory: u'n'
While opening s
[Errno 2] No such file or directory: u's'
While opening e
[Errno 2] No such file or directory: u'e'
While opening t
[Errno 2] No such file or directory: u't'
>>>ResourceManager('@sim')
<ResourceManager(<VisaLibrary(u'u')>)>

I don't get why this happens.

hgrecco commented 9 years ago

Probably you have an old version of pyvisa. Please update to the latest in github. We were stabilizing the hooking API.

Python 2.7.8 (v2.7.8:ee879c0ffa11, Jun 29 2014, 21:07:35)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import visa
>>> rm = visa.ResourceManager('@sim')

My detaills are:

Machine Details:
   Platform ID:    Darwin-10.8.0-x86_64-i386-64bit
   Processor:      i386

Python:
   Implementation: CPython
   Executable:     /Users/grecco/envs/pyvisadev27/bin/python
   Version:        2.7.8
   Compiler:       GCC 4.2.1 (Apple Inc. build 5666) (dot 3)
   Bits:           64bit
   Build:          Jun 29 2014 21:07:35 (#v2.7.8:ee879c0ffa11)
   Unicode:        UCS2

PyVISA Version: 1.6.2.dev0

Backends:
   ni:
      Version: 1.6.2.dev0 (bundled with PyVISA)
      #1: /Library/Frameworks/visa.framework/visa:
         found by: auto
         bitness: 32
         Could not get more info: Interpreter and library have different bitness.
   sim:
      Does not provide debug info
MatthieuDartiailh commented 9 years ago

I though 1.6.1 was enough. It works indeed with latest master.

hgrecco commented 9 years ago

If you are interested in pyvisa-sim, we could discuss a few of the features that are needed and how to implement them.

MatthieuDartiailh commented 9 years ago

I actually am. I need to test some of my code using instruments. I don't forget Pint but right now I have other priorities.