vivekuppal / transcribe

Transcribe is a real time transcription, conversation, Language learning platform. It provides live transcripts from microphone and speaker. It generates a suggested conversation response using OpenAI's GPT API. It will read out the responses, simulating a real live conversation in English or another language.
https://abhinavuppal1.github.io/
MIT License
194 stars 46 forks source link

Failure to Install Whisper dependencies and then TypeError #35

Closed vamsinimmalaML closed 1 year ago

vamsinimmalaML commented 1 year ago

I have been using your Transcribe project for a project related to speech transcription. First of all, thank you for creating such a useful tool!

I have encountered an issue while trying to run the Transcribe project in my local environment. Whenever I execute the main.py script, I encounter the following error:

Traceback (most recent call last): File "main.py", line 8, in <module> from AudioTranscriber import AudioTranscriber File "D:\HelperProject\transcribe\AudioTranscriber.py", line 7, in <module> import whisper File "D:\HelperProject\transcribe\transcribeENV\lib\site-packages\whisper.py", line 69, in <module> libc = ctypes.CDLL(libc_name) File "C:\Users\Golla Prasoona\anaconda3\lib\ctypes\__init__.py", line 363, in __init__ if '/' in name or '\\' in name: TypeError: argument of type 'NoneType' is not iterable

I have tried various troubleshooting steps, such as upgrading pip, reinstalling the whisper package, and verifying the presence of whisper.py in the site-packages directory, but the issue persists.

My system environment is as follows:

Operating System: Windows 64 bit Python Version: Python 3.8.8 Pip Version: pip 23.2.1

vivekuppal commented 1 year ago

Formatted traceback is below.

Traceback (most recent call last): File "main.py",
line 8, in <module> from AudioTranscriber import AudioTranscriber File "D:\Interview Helper Project\transcribe\AudioTranscriber.py", 
line 7, in <module> import whisper File "D:\Interview Helper Project\transcribe\transcribeENV\lib\site-packages\whisper.py", 
line 69, in <module> libc = ctypes.CDLL(libc_name) File "C:\Users\Golla Prasoona\anaconda3\lib\ctypes\__init__.py", 
line 363, in __init__ if '/' in name or '\\' in name: 

TypeError: argument of type 'NoneType' is not iterable

Seems like there is an issue in environment set up. The file whisper.py should be picked up from the location D:\Interview Helper Project\transcribe\custom_speech_recognition\recognizers\whisper.py but it is being picked up from the location D:\Interview Helper Project\transcribe\transcribeENV\lib\site-packages\whisper.py

We do not need to install whisper python package separately to be able to use transcribe.

Could you please share the output of pip list in your env. Also please describe the detailed complete steps you used for setting up the environment.

vamsinimmalaML commented 1 year ago

Thank you so much for your prompt response and for investigating the issue I encountered. I truly appreciate your help in resolving this matter.

You are absolutely right; it seems that the whisper.py file is being picked up from the wrong location in my environment. Instead of being imported from the expected location at D:\Interview Helper Project\transcribe\custom_speech_recognition\recognizers\whisper.py, it is being imported from D:\Interview Helper Project\transcribe\transcribeENV\lib\site-packages\whisper.py. I apologize for any confusion my setup may have caused.

Regarding your inquiry about the steps I used for setting up the environment, here are the detailed steps I followed:

Cloned the Transcribe repository from GitHub using the command: git clone https://github.com/vivekuppal/transcribe Navigated to the transcribe folder: cd transcribe Created a virtual environment named transcribeENV using: python -m venv transcribeENV Activated the virtual environment: transcribeENV\Scripts\activate Installed the required packages using the command: pip install -r requirements.txt Verified the installation of whisper package, but encountered the ImportError. Here is the output of pip list in my transcribeENV environment:

`(transcribeENV) PS D:\Interview Helper Project\transcribe> pip list Package Version


aiohttp 3.8.5 aiosignal 1.3.1 altgraph 0.17.3 async-timeout 4.0.2 attrs 23.1.0 certifi 2023.7.22 charset-normalizer 3.2.0 colorama 0.4.6 customtkinter 5.1.3 darkdetect 0.8.0 ffmpeg-python 0.2.0 filelock 3.12.2 frozenlist 1.4.0 future 0.18.3 idna 3.4 importlib-metadata 6.8.0 Jinja2 3.1.2 llvmlite 0.40.1 MarkupSafe 2.1.3 more-itertools 9.1.0 mpmath 1.3.0 multidict 6.0.4 networkx 3.1 numba 0.57.1 numpy 1.24.3 openai 0.27.6 openai-whisper 20230314 pefile 2023.2.7 pip 23.2.1 PyAudioWPatch 0.2.12.5 pyinstaller 5.13.0 pyinstaller-hooks-contrib 2023.6 pyperclip 1.8.2 pywin32-ctypes 0.2.2 PyYAML 6.0.1 regex 2023.6.3 requests 2.31.0 setuptools 49.2.1 six 1.16.0 sympy 1.12 tiktoken 0.3.1 torch 2.0.1+cu117 tqdm 4.65.0 typing_extensions 4.7.1 urllib3 2.0.4 Wave 0.0.2 whisper 1.1.10 yarl 1.9.2 zipp 3.16.2`

vivekuppal commented 1 year ago

The library whisper 1.1.10 is installed in env which is not required. My first guess is that if whisper is uninstalled from the env very likely this issue will be resolved.

vivekuppal commented 1 year ago

I believe the issue will be resolved by uninstalling the whisper library. Closing the issue. Please re-open if this continues to be a problem.