I have the following code in my flask_app.py file:
import openai
from flask import Flask, render_template, request, session import
flask import requests
app = Flask(__name__)
openai.api_key = <my API key>
When I try to run my webapp, I get the following in the error log:
Error running WSGI application 2023-08-07 09:10:59,998: NameError:
name 'openai' is not defined 2023-08-07 09:10:59,998: File
"/var/www/mariaia_pythonanywhere_com_wsgi.py", line 16, in <module>
2023-08-07 09:10:59,998: from flask_app import app as application
# noqa 2023-08-07 09:10:59,999: 2023-08-07 09:10:59,999: File "/home/mariaia/mysite/flask_app.py", line 2, in module> 2023-08-07
09:10:59,999: openai.api_key = <my API key>
Any suggestions on how I can fix this?