Moku model: Moku:Go
Operating system: Windows 11
Software version: MokuCLI: 2.2.3, Moku python API 3.3.3, Python 3.13.2
Firmware version: 601.0
Bug or support request description:
When trying to start a streaming session on a lock in amplifier in multi instrument mode I get the following error:
File "C:\Users\jrt3\Pycharm Projects\EUVRadiometer\euv_moku_interface.py", line 156, in <module>
example_live_plot_output(euv_interface)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "C:\Users\jrt3\Pycharm Projects\EUVRadiometer\euv_moku_interface.py", line 119, in example_live_plot_output
lia_stream = moku_interface.lia.start_streaming()
File "C:\Users\jrt3\Pycharm Projects\EUVRadiometer\.venv\Lib\site-packages\moku\instruments\_lockinamp.py", line 855, in start_streaming
super().start_streaming()
~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\jrt3\Pycharm Projects\EUVRadiometer\.venv\Lib\site-packages\moku\instruments\_stream.py", line 123, in start_streaming
check_mokucli_version(MOKU_CLI_PATH, self._compat_cli_ver)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jrt3\Pycharm Projects\EUVRadiometer\.venv\Lib\site-packages\moku\utilities.py", line 17, in check_mokucli_version
out, _ = Popen([cli_path, "--version"], stdout=PIPE, stderr=PIPE).communicate()
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jrt3\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1038, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pass_fds, cwd, env,
^^^^^^^^^^^^^^^^^^^
...<5 lines>...
gid, gids, uid, umask,
^^^^^^^^^^^^^^^^^^^^^^
start_new_session, process_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\jrt3\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1550, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
# no special security
^^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
cwd,
^^^^
startupinfo)
^^^^^^^^^^^^
PermissionError: [WinError 5] Access is denied
I tried many things including running as adminstrator, modifying permissions on files etc, but after some debugging I found there is perhaps a bug in line 17 of moku.init.py:
MOKU_CLI_PATH = environ.get("MOKU_CLI_PATH", which("mokucli"))
# This seems to return the path to the folder rather than the executable.
>> 'C:\\Program Files\\Liquid Instruments\\Moku CLI\\'
I changed this line to
MOKU_CLI_PATH = which(os.environ.get('MOKU_CLI_PATH') + 'mokucli')
# This gives the executable file
>>'C:\\Program Files\\Liquid Instruments\\Moku CLI\\mokucli.EXE'
This change allowed streaming to work.