Events
17 Mar, 21 - 21 Mar, 10
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Learn how to install the ML.NET CLI (command-line interface) on Windows, Mac, or Linux.
The ML.NET CLI generates good quality ML.NET models and source code using automated machine learning (AutoML) and a training dataset.
Note
This article refers to ML.NET CLI and ML.NET AutoML, which are currently in preview, and material is subject to change.
(Optional) Visual Studio 2022
You can run the generated C# code projects with Visual Studio by pressing the F5 key or with dotnet run
(.NET CLI).
Note: If after installing .NET SDK the dotnet tool
command is not working, sign out from Windows and sign in again.
The ML.NET CLI is installed like any other dotnet Global Tool. You use the dotnet tool install --global
.NET CLI command.
The ML.NET CLI is available for Windows, macOS, and Linux. Depending on your processor architecture, choose the x64 or ARM version.
Note
ARM based versions of the ML.NET CLI don't support image classification scenarios.
dotnet tool install --global mlnet-linux-x64
dotnet tool install --global mlnet-linux-arm64
If the tool can't be installed (that is, if it is not available at the default NuGet feed), error messages are displayed. Check that the feeds you expected are being checked.
If installation is successful, a message is displayed showing the command used to call the tool and the version installed, similar to the following example:
You can invoke the tool using the following command: mlnet
Tool 'mlnet-<OS>-<ARCH>' (version 'X.X.X') was successfully installed.
The OS
and ARCH
in this case should match the values for the operating system and processor architecture you selected when installing the ML.NET CLI.
You can confirm the installation was successful by typing the following command:
mlnet
You should see the help for available commands for the mlnet tool such as the 'classification' command.
Important
If you're running Linux or macOS and using a console other than Bash (for example, zsh, which is the new default for macOS), then you'll need to give mlnet
executable permissions and include mlnet
to the system path. In general, you can do so with the following command:
chmod +x <PATH-TO-MLNET-CLI-EXECUTABLE>
More detailed instructions on how to do this should appear in the terminal when you install mlnet
(or any global tool).
Alternatively, you can try using the following command to run the mlnet tool:
~/.dotnet/tools/mlnet
If you're trying to install a prerelease version or a specific version of the tool, you can specify the OS, processor architecture, and framework using the following format:
dotnet tool install -g mlnet-<OS>-<ARCH> --framework <FRAMEWORK>
You can also check if the package is properly installed by typing the following command:
dotnet tool list -g
To uninstall the ML.NET CLI use the package ID you can get from running the dotnet tool list --global
command. Then, use the dotnet tool uninstall --global
command.
dotnet tool uninstall --global mlnet-linux-x64
dotnet tool uninstall --global mlnet-linux-arm64
To update the ML.NET CLI use the package ID you can get from running the dotnet tool list --global
command. Then, use the dotnet tool update --global
command.
dotnet tool update --global mlnet-linux-x64
dotnet tool update --global mlnet-linux-arm64
The ML.NET CLI can be installed in the default directory or in a specific location. The default directories are:
OS | Path |
---|---|
Linux/macOS | $HOME/.dotnet/tools |
Windows | %USERPROFILE%\.dotnet\tools |
These locations are added to the user's path when the SDK is first run, so Global Tools installed there can be called directly.
Note: the Global Tools are user-specific, not machine global. Being user-specific means you cannot install a Global Tool that is available to all users of the machine. The tool is only available for each user profile where the tool was installed.
Global Tools can also be installed in a specific directory. When installed in a specific directory, the user must ensure the command is available, by including that directory in the path, by calling the command with the directory specified, or calling the tool from within the specified directory. In this case, the .NET CLI doesn't add this location automatically to the PATH environment variable.
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Events
17 Mar, 21 - 21 Mar, 10
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Use developer tools to extend Power Platform - Training
This module will focus on the available developer tools that can help you perform development activities with Power Platform.
Certification
Microsoft Certified: Azure AI Fundamentals - Certifications
Demonstrate fundamental AI concepts related to the development of software and services of Microsoft Azure to create AI solutions.