antiboredom/videogrep

Trouble running videogrep

Kaelinator opened this issue · 3 comments

When I try to run videogrep through cli, I get

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

Running Windows 10, it seems that in Python36-32\Scripts, it seems that the videogrep file is not a .exe like the others. I believe this is the culprit, but I'm not sure how to make it a .exe.

When I try to run videogrep through cli, I get

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

Running Windows 10, it seems that in Python36-32\Scripts, it seems that the videogrep file is not a .exe like the others. I believe this is the culprit, but I'm not sure how to make it a .exe.

I'm having the same problem, to help everyone I have more information, the file videogrep is actually a small python script with the content:

#!c:\users\msi gx63vr\appdata\local\programs\python\python36\python.exe

from videogrep import videogrep
if __name__ == '__main__':
    videogrep.main()

When I changed that file to .py it ran but it says ImportError: cannot import name 'videogrep', so I tried inputting each line in a python cmd in another directory and it does import, but when I input the videogrep.main() it says AttributeError: 'function' object has no attribute 'main', then I realized it's a function so I ran videogrep() and it gave me a somewhat "successful" error: TypeError: videogrep() missing 4 required positional arguments: 'inputfile', 'outputfile', 'search', and 'searchtype'.

But it's still impossible to run it from CLI, there's the same ImportError: cannot import name 'videogrep' error.

EDIT: I'm using Python 3.6.4 (64-bit).
EDIT 2: When I try using the function I still get an error like below:

[!] No vtt files were found.
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    videogrep('GLITCH SLIMES.mp4','output.mp4','slimes','re',use_vtt=True)
  File "C:\Users\MSI GX63VR\AppData\Local\Programs\Python\Python36\lib\site-packages\videogrep\videogrep.py", line 453, in videogrep
    composition = compose_from_vtt(vtts, search, searchtype)
  File "C:\Users\MSI GX63VR\AppData\Local\Programs\Python\Python36\lib\site-packages\videogrep\videogrep.py", line 408, in compose_from_vtt
    for f in files:
TypeError: 'bool' object is not iterable

I tried opening a cmd in C:\Users\MSI GX63VR\AppData\Local\Programs\Python\Python36\Lib\site-packages\videogrep and running the command but then it gives a new error called ModuleNotFoundError: No module named '__main__.vtt'; '__main__' is not a package, for reference there's a open issue about that one on #57.

Workaround on Windows 10:

python -mvideogrep.videogrep --input input.mp4 --search searchterm --use-vtt

Workaround on Windows 10:

python -mvideogrep.videogrep --input input.mp4 --search searchterm --use-vtt

It works perfectly.

EDIT: @Kaelinator the solution would be to simply make a videogrep.bat in a PATH directory containing this:

@echo off
python -m videogrep.videogrep %*

Could also compile it to an exe but it's optional.