Closed joseph2rs closed 4 years ago
Sorry about that. I do not actively maintain this package since I was unconvinced from the start by some design choices, but I was not planning to break it. The issue seems to be related to imports from pyvisa.compat
if you track them down, everything should work again. If you can submit a PR it would be great.
I haven't dug into this too much, so sorry if I'm just repeating the same issue, but I notice that with pyvisa 1.11.0 (and 1.11.1) I'm unable to use pyvisa-sim even with my custom yaml. As with @joseph2rs, I don't have any problems with 1.10.1.
The issue seems related to the "write_raw" method in pyvisa/messagebased.py.
self = <'SerialInstrument'('ASRL13::INSTR')>, message = b'SYSTEM:REMOTE\r\n'
def write_raw(self, message: bytes) -> int:
"""Write a byte message to the device.
Parameters
----------
message : bytes
The message to be sent.
Returns
-------
int
Number of bytes written
"""
> return self.visalib.write(self.session, message)[0]
E TypeError: 'NoneType' object is not subscriptable
Pyvisa-sim relies on the presence of pyvisa.compat which was removed with the end of support for Python 2. I am kind of surprised the system does not crash earlier... I will do my best to put a PR tomorrow night to address this issue.
0.4.0 is released and addresses this issue.
Thanks @MatthieuDartiailh. 0.4.0 fixed my problem!
With the new PyVisa 1.11.0, pyvisa is not able to load pyvisa-sim backend.
Stacktrace :
It works as expected with 1.10.1
Installed versions :
pyvisa==1.11.0 pyvisa-sim==0.3
Ubuntu 18.04 (x64) Python 3.6 (x64)
No other VISA backends installed