Streaming CLI path issue

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.

Hi Jack,

You’re right that the MOKU_CLI_PATH should return ‘C:\Program Files\Liquid Instruments\Moku CLI\mokucli.EXE’, and I’m glad you could get that working. However I think the error you were getting initially is because you are using an old version of mokucli (looking at check_mokucli_version(MOKU_CLI_PATH, self._compat_cli_ver).

If you revert these changes and then update your mokucli to the latest package you should be able to stream without any errors. You can download the latest mokicli package from Utilities. The installation wizard will configure everything needed to launch the CLI successfully.

Let me know how this goes

Hi Indira, I downloaded my installation of the mokuCLI from utilities as you had suggested, and that was the version I got. Are there instructions for updating the CLI another way? It seems 2.2.3 is the latest version of windows.

Thanks

-Jack

Hello Jack,
The latest version of mokucli for all OS is 2.3.1. Please try downloading again and going through the installation wizard, ensuring to delete the old installation. Then run:
mokucli --version
in your terminal to verify the newest version is installed. Please let me know how it goes and if you need any more assistance!

Hi Dylan, downloading the latest version and installing through the wizard got me to 2.3.0, but I still don’t see 2.3.1. I don’t have any issues with 2.3.0 so far though.

Thanks.