Jaymon / transcribe

Convert images or audio files to plain text on the command line
MIT License
32 stars 7 forks source link

captain.exception.ParseError: no main function found #2

Closed kraftydevil closed 5 years ago

kraftydevil commented 5 years ago
$ transcribe speech test.wav
Traceback (most recent call last):
  File "/usr/local/bin/transcribe", line 10, in <module>
    sys.exit(console())
  File "/usr/local/lib/python3.7/site-packages/captain/__init__.py", line 102, in exit
    s = Script(inspect.getfile(calling_mod), module=calling_mod)
  File "/usr/local/lib/python3.7/site-packages/captain/__init__.py", line 209, in __init__
    self.parse()
  File "/usr/local/lib/python3.7/site-packages/captain/__init__.py", line 324, in parse
    raise ParseError("no main function found")
captain.exception.ParseError: no main function found
Jaymon commented 5 years ago

can you pip freeze and give me the version of captain that's installed? I think I know the problem and that will help me verify. Thanks

kraftydevil commented 5 years ago

yep, using captain==2.0.4

Jaymon commented 5 years ago

I wasn't able to duplicate this using transcribe 0.0.3 and captain 2.0.4, make sure you're running the latest:

$ transcribe --version

If you aren't, then update it:

$ pip install --upgrade transcribe

If that doesn't work let me know and I'll install it completely clean room and see if I can duplicate the issue instead of relying on my development environment

kraftydevil commented 5 years ago

I'm indeed running 0.0.3, although transcribe --version crashes:

$ transcribe --version
Traceback (most recent call last):
  File "/usr/local/bin/transcribe", line 10, in <module>
    sys.exit(console())
  File "/usr/local/lib/python3.7/site-packages/captain/__init__.py", line 102, in exit
    s = Script(inspect.getfile(calling_mod), module=calling_mod)
  File "/usr/local/lib/python3.7/site-packages/captain/__init__.py", line 209, in __init__
    self.parse()
  File "/usr/local/lib/python3.7/site-packages/captain/__init__.py", line 324, in parse
    raise ParseError("no main function found")
captain.exception.ParseError: no main function found

$ pip3 install --upgrade transcribe
Requirement already up-to-date: transcribe in /usr/local/lib/python3.7/site-packages (0.0.3)
Jaymon commented 5 years ago

aight, it's got to be an issue with the installation then, I'm going to spin up a vagrant box and see if I can duplicate

Jaymon commented 5 years ago

What OS are you using?

I brought up a new ubuntu bionic vagrant box and ran this:

$ sudo su
$ apt-get update
$ apt-get install -y --no-install-recommends python3-pip python3-setuptools
$ pip3 install --upgrade "git+https://github.com/Jaymon/transcribe#egg=transcribe"
$ transcribe --version
transcribe 0.0.4

So it worked as expected.

I did update the setup.py file because it was way out of date, so version 0.0.4 is now in Github and on pypi

kraftydevil commented 5 years ago

Mac OS 10.13.6 - I updated to 0.0.4 with the same issue

Jaymon commented 5 years ago

Boom! I've been able to duplicate it with a virtual environment on my Mac, not sure why it's different, debugging it now

Jaymon commented 5 years ago

Gah, I thought I had a bandaid fix that would get transcribe working temporarily while I figured out the issue with captain but, sadly, it didn't work, so now it's going to take some time, in the meantime, just cloning the repo and running it like:

$ python3 -m transcribe speech test.wav

should work since it should bypass the problem with captain.

ShruAnanth commented 5 years ago

Hi Jaymon,, I was able to run the transcribe command for mp3 to speech conversion - hitting the GC. But how do I see the transcript file or the how do I read the speech? Please let me know. Thanks !

Jaymon commented 5 years ago

@ShruAnanth you should open a new issue asking for help, in that issue you should add the full command you ran and the output it produced. Thanks

Jaymon commented 5 years ago

@kraftydevil ok, this problem, and a whole bunch of others when running in python 3, should be fixed, you can update:

$ pip install --upgrade transcribe
$ pip install --upgrade captain

and it should work.

Thanks for your help tracking this down :)

kraftydevil commented 5 years ago

Yep, I'm now able to run transcribe from the command line 👍 I found something else while trying speech so I'll post that in a new issue