Mac M1: CLI SPX Command not found

hendryman 11 Reputation points

On my Macbook M1 (20219, MacOS 12.4) I have successfully installed
and the Speech CLI via
dotnet tool install --global Microsoft.CognitiveServices.Speech.CLI
but when I type
spx help
I get
zsh: command not found: spx

How can I fix this?

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,286 questions
{count} vote

6 answers

Sort by: Most helpful
  1. YutongTie-MSFT 43,411 Reputation points

    Hello @hendryman

    If you have installed spx successful but you can not run it, it seems like there is something wrong with your environment var - PATH, especially you are using z shell.

    I have seen a thread which mentioned similar problem and I think you may want to take a look -

    If you still have this issue after set the PATH well, please let us know, we are glad to help you raise a support ticket to investigate your local environment.

    Looking forward to your response and I hope this helps.


    1 person found this answer helpful.
    0 comments No comments

  2. bozolino 5 Reputation points

    thanks! tried


    but received this error

    Unhandled exception. System.BadImageFormatException: Could not load file or assembly '/Users/username/.dotnet/tools/.store/microsoft.cognitiveservices.speech.cli/1.25.0/microsoft.cognitiveservices.speech.cli/1.25.0/tools/net6.0/any/spx.dll'. An attempt was made to load a program with an incorrect format.

    File name: '/Users/username/.dotnet/tools/.store/microsoft.cognitiveservices.speech.cli/1.25.0/microsoft.cognitiveservices.speech.cli/1.25.0/tools/net6.0/any/spx.dll'

    [1] 14615 abort ~/.dotnet/tools/spx

    1 person found this answer helpful.

  3. hendryman 11 Reputation points

    Thank you, Yutong. Tried and failed.

    0 comments No comments

  4. bozolino 5 Reputation points

    Still not working. Can anyone please help?

    0 comments No comments

  5. Bruce ( 52,826 Reputation points

    ls ~/.dotnet/tools

    should show spx as an executable. if it does, then you do not have your $path set correctly to find it.

    you can also run it explicitly:


    0 comments No comments