dotnet / machinelearning-samples

Samples for ML.NET, an open source and cross-platform machine learning framework for .NET.
https://dot.net/ml
MIT License
4.46k stars 2.68k forks source link

'mlnet' already installed, Command 'mlnet' not found #447

Closed david-waterworth closed 5 years ago

david-waterworth commented 5 years ago

Problem encountered on https://dotnet.microsoft.com/learn/machinelearning-ai/ml-dotnet-get-started-tutorial/install Operating System: Linux Ubuntu 18.04 - x64

I'm trying to work through the tutorial. I've installed mlnet using dotnet tool install but when I try and run it, I get command not found. I guess the install location isn't on my path?

~$ dotnet tool install -g mlnet
Tool 'mlnet' is already installed.

~$ mlnet
Command 'mlnet' not found, but can be installed with:

sudo apt install mldonkey-server
danucalovj commented 5 years ago

Try

dotnet mlnet ...arguments

The mlnet tool needs to run under the context of dotnet

justinormont commented 5 years ago

Can you run dotnet tool list -g to show what's installed?

You should see mlnet listed: (though at v0.3.0)

$ dotnet tool list -g
Package Id      Version                    Commands
---------------------------------------------------
mlnet           0.4.0-preview-27703-0      mlnet 

If mlnet runs directly, ~/.dotnet/tools/mlnet --version, you can add it to your path.

justinormont commented 5 years ago

Looks like dotnet install isn't adding to the path in Ubuntu:

On Ubuntu (18.04) the .NET SDK install did not properly add the ~/.dotnet/tools folder to the user path, and so I had to explicitly add that path to my environment after the .NET SDK/Runtime install.

Via: https://weblog.west-wind.com/posts/2018/Nov/05/Creating-a-NET-Global-Tool-from-an-existing-Console-Application

You can add export PATH="$PATH:~/.dotnet/tools" to your .bashrc file. Afterwards, you'll need to restart your terminal, or source the file source ~/.bashrc.

david-waterworth commented 5 years ago

Thanks @justinormont that was the problem, adding ~/.dotnet/tools to my PATH works.

wli3 commented 5 years ago

Note, if you are using bash shell, you do not need to add it to PATH. It should be handled already.

Also, if you see the following you need to restart your session

Since you just installed the .NET Core SDK, you will need to logout or restart your session before running the tool you installed. You can invoke the tool using the following command: mlnet Tool 'mlnet' (version '0.3.0') was successfully installed.