ericmjl/Network-Analysis-Made-Simple

checkenv.py returns error after environment install successful

Closed this issue · 2 comments

(nams) C:\Users\ssbra\Desktop\Network-Analysis-Made-Simple>python checkenv.py 'command' is not recognized as an internal or external command, operable program or batch file. Traceback (most recent call last): File "C:\Users\ssbra\Desktop\Network-Analysis-Made-Simple\checkenv.py", line 57, in <module> assert not os.system("command -v ffmpeg"), "please install ffmpeg" AssertionError: please install ffmpeg

I did check to be sure the package ffmpeg had been installed in the env, not sure why this error would persist.

From my vague memory this usually happens when ffmpeg isn't added to the Path variable. While installing ffmpeg did you edit the Path variable too?

Thanks!

This happened to me on windows.

There's no command -v available on windows. Powershell has Get-Command.
As a quick fix, I'd suggest the following change to checkenv.py:

if os.name != 'nt':   # check if not windows
    assert not os.system("command -v ffmpeg"), "please install ffmpeg"
else:
    assert not os.system("ffmpeg -version > $null")

A more modern approach to avoid the if-statement might be to update to the subprocess command and check the returncode:

import subprocess
result = subprocess.run("ffmpeg -version", shell=True)
assert result.returncode == 0, "please install ffmpeg"