saharmor / whisper-playground

Build real time speech2text web apps using OpenAI's Whisper https://openai.com/blog/whisper/
MIT License
777 stars 140 forks source link

How to investigate the problem of "No module named 'flask_cors'"? #13

Closed yubrshen closed 1 year ago

yubrshen commented 1 year ago

Right after setting up per the instruction, in the same terminal of setting up, when executing flask run --port 8000

I got the following error:
  File "/home/yshen/dev/whisper-playground/backend/app.py", line 5, in <module>
    from flask_cors import CORS
ModuleNotFoundError: No module named 'flask_cors'

but when I execute import flask_cors in python interactive session, it worked.

(venv) yshen@ys-private:~/dev/whisper-playground/backend$ python
Python 3.10.8 (main, Nov 24 2022, 14:13:03) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import flask_cors
>>>

How should I investigate the problem?

yubrshen commented 1 year ago

My problem is solved by opening a new terminal and activating the venv environment.