Zuhair Mirza
Zuhair Mirza

Reputation: 127

Vowpal Wabbit command not found: No such file or directory

When I enter this command:

./vw -d click.train.vw -f click.model.vw --loss_function logistic

on cygwin I got this error:

-bash: ./vw: No such file or directory

I actually want to implement "PREDICTING CTR WITH ONLINE MACHINE LEARNING" website link for reference : http://mlwave.com/predicting-click-through-rates-with-online-machine-learning/

Any help would be appreciated.

Upvotes: 0

Views: 752

Answers (1)

whoan
whoan

Reputation: 8521

Answer based on common mistakes.

Execution by inexact name

Filename with blanks

Suppose you write ls in the command line and obtain the following:

$ ls 
anyfile  command 

Then, you call your command with ./command and get the following:

$ ./command
bash: ./command: No such file or directory

Here you can think ls is wrong, but the actuality is that you can't easily recognize if a filename have, for example, leading or trailing spaces:

$ ls -Q  # -Q, --quote-name -> enclose entry names in double quotes
"anyfile"  "command "

As you see, here my command has a trailing space:

$ ./"command "  # it works

Filename with extension

A common mistake is to call the command by the name without the extension (if any).
Let's name the command: command.sh:

$ ./command # wrong
$ ./command.sh # OK

Wrong file path

If you call your command with the prefix ./, it needs to be in your current directory ($PWD). If it is not, you will get:

$ ./command # relative path -> same as "$PWD/command"
bash: ./command: No such file or directory

In that case, you can try the following:

Executing the command by its absolute path

$ /home/user/command # absolute path (example). It starts with a slash (/).

Let the shell locate the command

If you provide just the command name without slashes, bash searches in each directory of the $PATH variable, for an executable file named command.

$ command

You can do that search with the which command:

$ which command
/usr/bin/command

If the search fails, you'll get comething like:

$ which unexistent_command
which: no unexistent_command in (/usr/local/sbin:/usr/local/bin:/usr/bin)

Broken link

Now, suppose you write ls -Q in the command line and obtain the following:

$ ls -Q
"anyfile"  "command"

This time, you can be 100% secure command exists but when you try to execute it:

$ ./command
bash: ./command: No such file or directory

Reason? bash complains command doesn't exist, but what doesn't exist is the file command is pointing to by a Symbolic link. e.g.:

$ ls -l
total 0
-rw-r--r-- 1 user users  0 Jan 14 02:12 anyfile
lrwxrwxrwx 1 user users 27 Jan 14 02:12 command -> /usr/bin/unexistent_command

$ ls /usr/bin/unexistent_command
ls: cannot access /usr/bin/unexistent_command: No such file or directory

Notice that the following surely throw different errors that the one you are getting...

Execution permission

To execute a file, it must have the x bit activated. With ls -l you can check the file permission.

$ ls -l command
-rw-r--r-- 1 user users 0 Jan  3 19:52 command

In this case (it doesn't have the x bit activated), you can give permission with chmod:

$ chmod +x command
$ ls -l command
-rwxr-xr-x 1 user users 0 Jan  3 19:52 command

Upvotes: 1

Related Questions