Python Forum
ModuleNotFoundError: No module named '__main__.vtt'; '__main__' is not a package
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ModuleNotFoundError: No module named '__main__.vtt'; '__main__' is not a package
#1
https://github.com/antiboredom/videogrep
I am using 64bit Win10, python 32bit 3.70, everything installed fine, but I got this, problem.
already .srt or .vtt subtitle on folder and subtitle is showing on vlc player.
I already post here: https://github.com/antiboredom/videogrep/issues/57
but authors or other contributor are not replied till now!
I hope someone take a look into and solve for me.

G:\Python37\Lib\site-packages\videogrep>videogrep
Traceback (most recent call last):
  File "G:\Python37\Lib\site-packages\videogrep\videogrep.py", line 14, in <module>
    from .vtt import parse_auto_sub
ModuleNotFoundError: No module named '__main__.vtt'; '__main__' is not a package

G:\Python37\Lib\site-packages\videogrep>
Reply
#2
Quote:I am using 64bit Win10, python 32bit 3.70, everything installed fine, but I got this, problem.
First of all, if you have a 64 bit windows system, why are you running 32 bit python? you should load 64 bit 3.7
Typical command line: videogrep --input path/to/video_or_folder --search 'search phrase'
if it was installed with pip, you shouldn't have any problem running it.
You should not (according to given docs) have to specify site-packages, unless python was not installed properly.
If you have doubts about this, look at:
https://python-forum.io/Thread-Basic-Par...er-Windows
and
https://python-forum.io/Thread-Part-2-Py...nt-Windows
Reply
#3
I read somewhere 32bit better on python modules, I always prioritize 64bit apps, so I installed 64bit python. Then I got same problem over and over, I am totally clueless for last 1 month, then I researched myself before asking help. After all I failed. Thus I make post on official github issue section. But no reply from them.
Now, back to original issue. I uninstalled fully 32bit, then I installed 64bit freshly. I follow step by step your tutorials about pip.
then I installed package with pip.
Yes, I already made same name .mp4 and .srt file and shocked to get same error as first post.
By the way I change drive as I always used other drive rather than C. I set up all environment variable path both G and C.
I tried python 2.7, but it can't installed properly.
I used many other package with pip from Github, never getting like this.

really clueless about it. maybe it remain mystery for me.
Reply
#4
did you click the option to add python to the path?
If not, you will have to manually do that. I don't know if this is the issue causing your problem or not, but it seems as though it could be.
Reply
#5
Try to execute the videogrep command from another directory. It is not a good idea to execute it from G:\Python37\Lib\site-packages\videogrep. It looks as if python executes videogrep.py as a script instead of importing it as a module.
Reply
#6
Larz60+, I add path, even I got any error, then I setup path manually every time.
Gribouillis, did that many times!
C:\Python37>videogrep
Traceback (most recent call last):
  File "C:\Python37\Lib\site-packages\videogrep\videogrep.py", line 14, in <module>
    from .vtt import parse_auto_sub
ModuleNotFoundError: No module named '__main__.vtt'; '__main__' is not a package

C:\Python37>
I tried videogrep with Linux inside virtualbox to test if i get same error like it, but I never used linux before, i got different error like
E: command not found.

I assume original author used mac osx, and he also made desktop only mac version. so may be mac osx works with videogrep.
Have you tested really this package your pc. thanks for reply
Reply
#7
Can you try in the python REPL?
>>> import videogrep
>>> videogrep.main()
Reply
#8
Can you try in the python REPL?
sorry I don't know REPL. may be learn about this later, as I just started python for 2 months ago.
C:\Python37>python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import videogrep
>>> videogrep.main()
usage:  [-h] --input [INPUTFILE [INPUTFILE ...]] [--search SEARCH]
        [--search-type {re,pos,hyper,fragment,franken,word}]
        [--use-transcript] [--use-vtt] [--max-clips MAXCLIPS]
        [--output OUTPUTFILE] [--export-clips] [--demo] [--randomize]
        [--youtube YOUTUBE] [--padding PADDING] [--resyncsubs SYNC]
        [--transcribe] [--ngrams NGRAMS]
: error: the following arguments are required: --input/-i
Reply
#9
So this works, it only wants an input file, create a file named 'myvideogrep.py' containing
import videogrep
if __name__ == '__main__':
    videogrep.main()
Then call it like so in cmd window
Output:
python myvideogrep.py -i C:\path\to\your\file
Reply
#10
[Image: reUA35C.jpg]
sorry, I don't create file like you said....wait don't need to reply.
I saved this in C:\Python37,

C:\Users\YL>python myvideogrep.py -i "C:\A" --search 'Not you' -o "C:\test.mp4"
(null): can't open file 'myvideogrep.py': [Errno 2] No such file or directory
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 852 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 23,623 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 2,519 Oct-29-2023, 11:33 PM
Last Post: Serg
  __name__ and __main__ in functions Mark17 3 726 Oct-12-2023, 01:55 AM
Last Post: deanhystad
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,421 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,483 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 1,311 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 1,020 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Help with pyinstaller "No module named" korenron 9 8,898 Jun-15-2023, 12:20 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 995 May-15-2023, 02:38 PM
Last Post: tonynapoli2309

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020