0

I've got this weird problem:

I added the path of libsvm's .exe files to my PATH. When I type svm-train (a libsvm command) into my cmd - it recognizes the command, and works as expected.

When I use python's IDLE GUI, and try:

os.system('svm-train')

it also works properly.

However, when I use the exact same command [os.system('svm-train')] in Eclipse (usingn Pydev), it gives me the following error:

'svm-train' is not recognized as an internal or external command, 
operable program or batch file.

Any idea what the problem could be?

Thanks!

Cheshie
  • 2,777
  • 6
  • 32
  • 51
  • How did you add it to the PATH? – nitind Jul 23 '14 at 22:27
  • Um like this: ";E:\Download\LIBSVM-3.18\libsvm-3.18\windows\". I wrote that it works from the command line so I think I added it correctly. – Cheshie Jul 23 '14 at 22:41
  • If you did this from the Command Prompt window, you only changed it for that specific window. To modify it system-wide, open the Properties for "This PC" (or "My Computer", or the Control Panel's "System") and open the Advanced system settings. From there, you can change the actual Environment variables, like PATH. – nitind Jul 23 '14 at 23:33
  • Yeah, thanks, that's what I did initially (doesn't work). – Cheshie Jul 23 '14 at 23:55

1 Answers1

1

Usually the issue is that the shell that started Eclipse doesn't have the PATH configured... Can you check?

i.e.: in your Python program do:

import os
print('\n'.join(sorted(os.environ['PATH'].split(';'))))

And see if the path containing svm-train is there...

Fabio Zadrozny
  • 24,814
  • 4
  • 66
  • 78