Home > Blockchain >  How to run python program
How to run python program

Time:10-26

I am trying to make some adjustments to this code and test it: https://github.com/openai/whisper

However, after I make the adjustments to the code, I am not sure how to run the whisper program as a CLI. I have it installed globally so I can run $ whisper properly, but how do I run it locally? I clearly don't understand python well enough, I have already ran $ python setup.py install, what is my next step? Thanks

I would have thought it would be $ python ./whisper but I receive an error:

Traceback (most recent call last):
  File "/Users/user/.pyenv/versions/3.9.0/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/user/.pyenv/versions/3.9.0/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/user/Development/whisper/test/whisper/whisper/__main__.py", line 1, in <module>
    from .transcribe import cli
ImportError: attempted relative import with no known parent package

CodePudding user response:

Try this

Clone the repo or Download the repository Zip.

Extract it

Open a terminal and change directory into the newly extracted folder

$ cd whisper

Then install the requirements by typing this

$ pip install requirements.txt

The file exist so it will work

Now create a wheel

$ python setup.py bdist_wheel

Wait for it to build. It will build a .whl file.

Now type the .whl full name to install or you can drag and drop after typing pip install and them space

$ pip install /path/to/{filename}-{version}-{pyversion}.whl

After its done installing.

Close the terminal and open another one and then call whisper

$ whisper

CodePudding user response:

You just need to follow the instructions on the README of the official GitHub. https://github.com/openai/whisper#readme

  • Related