mallorbc / whisper_mic

Project that allows one to use a microphone with OpenAI whisper.
MIT License
705 stars 158 forks source link

ModuleNotFoundError when trying to use whisper_mic.py #36

Closed Kamiikrazy closed 3 months ago

Kamiikrazy commented 1 year ago

I tried running python whisper_mic.py --help on the CLI and was met with an error.

C:\Users\[___]\anaconda3\envs\whisper\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
  warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
Traceback (most recent call last):
  File "C:\Users\[___]\pythonprojects\Amadeus\whisper_mic\whisper_mic\whisper_mic.py", line 14, in <module>
    from whisper_mic.utils import get_logger
  File "C:\Users\[___]\pythonprojects\Amadeus\whisper_mic\whisper_mic\whisper_mic.py", line 14, in <module>
    from whisper_mic.utils import get_logger
ModuleNotFoundError: No module named 'whisper_mic.utils'; 'whisper_mic' is not a package
mallorbc commented 1 year ago

You need to install this as a pip package and then use it as a CLI.

  1. pip install whisper-mic 2.whisper_mic
Shaikhyunus7039 commented 1 year ago

I tried running python whisper_mic.py --help on the CLI and was met with an error.

C:\Users\[___]\anaconda3\envs\whisper\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
  warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
Traceback (most recent call last):
  File "C:\Users\[___]\pythonprojects\Amadeus\whisper_mic\whisper_mic\whisper_mic.py", line 14, in <module>
    from whisper_mic.utils import get_logger
  File "C:\Users\[___]\pythonprojects\Amadeus\whisper_mic\whisper_mic\whisper_mic.py", line 14, in <module>
    from whisper_mic.utils import get_logger
ModuleNotFoundError: No module named 'whisper_mic.utils'; 'whisper_mic' is not a package

you have to put 'whisper_mic' folder in the same folder where your code is, i was having the same issue.

mallorbc commented 1 year ago

If you install this as a pip package, is it working?

yattuLizard commented 1 year ago

The problem is that the module you are trying to run is named whisper_mic.py. Line 15 says “from whisper_mic.utils import get_logger”, so the module name conflicts with the package name.Need to rename whisper_mic.py. Please do not change whisper_mic.py in the library.

Kenji0510 commented 7 months ago

The problem is that the module you are trying to run is named whisper_mic.py. Line 15 says “from whisper_mic.utils import get_logger”, so the module name conflicts with the package name.Need to rename whisper_mic.py. Please do not change whisper_mic.py in the library.

It was easy problem! Thank you!

mallorbc commented 3 months ago

I believe this is done. Please reopen if not.