jsoslow2 / AI-Therapist

Using GPT3 to Create an AI Therapist
BSD 3-Clause "New" or "Revised" License
31 stars 8 forks source link

No module named key_config #1

Open ghost opened 3 years ago

ghost commented 3 years ago

Getting this error in Arch x64

Traceback (most recent call last): File "application.py", line 28, in from key_config import * ModuleNotFoundError: No module named 'key_config'

AjayKhalsa commented 3 years ago

I am getting the same error there's supposed to be a file called key_config.py but the author deleted it. @jsoslow2 It would be really helpful if you could clarify this issue

AjayKhalsa commented 3 years ago

@yaoberh If you are still looking for the solution I switched Flask-SocketIO to 4.3.2 and it worked for me Refer this issue https://github.com/miguelgrinberg/python-socketio/issues/578#issuecomment-742477016

ghost commented 3 years ago

Hey, thanks for your help. Downgrading the package doesn't seem to solve it though. Did you do anything else?

AjayKhalsa commented 3 years ago

Oh yes I made a key_config.py file and added my flask and OpenAI key's like this

import os flask_secret_key = os.urandom(24) secret_key="InsertOpenAIkey"

ghost commented 3 years ago

Seems to be working now, although I get this error when launching from the console and It doesn't answer any text I put in: Client disconnected 5d7bb4bab0cb4f4992327fadcef5e670: Client is gone, closing socket 127.0.0.1 - - [14/Apr/2021 13:55:39] "GET /socket.io/?EIO=3&transport=polling&t=1618419301581-4&sid=5d7bb4bab0cb4f4992327fadcef5e670 HTTP/1.1" 200 -

teremterem commented 1 year ago

I have created a pull request to this repo that should solve both problems: 1) ModuleNotFoundError: No module named 'key_config' goes away because I introduced python-dotenv (in the updated README.md it says that you just need to create .env file with secrets for OpenAI and Flask in the root of the project) 2) Problem of socketio incompatibility between client and server goes away because I updated all the server libs as well as socketio lib in the client to the newest versions.

Here is the PR: #2 I hope the @jsoslow2 accepts and merges my PR. His AI-Therapist looks like a nice project.