mmz-001 / knowledge_gpt

Accurate answers and instant citations for your documents.
https://knowledgegpt.streamlit.app/
MIT License
1.6k stars 742 forks source link

Windows: ModuleNotFoundError: No module named 'openai' #17

Closed elisa-chou closed 1 year ago

elisa-chou commented 1 year ago

During the "poetry install step", there is an error msg: "Warning: poetry.lock is not consistent with pyproject.toml. You may be getting improper dependencies. Run poetry lock [--no-update] to fix it."

Afterwards, when I run "streamlit run main.py", there's error msg: ModuleNotFoundError: No module named 'openai'

Traceback: File "C:\Users\souler c\knowledge_gpt.venv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script exec(code, module.dict) File "C:\Users\souler c\knowledge_gpt\knowledge_gpt\main.py", line 3, in from openai.error import OpenAIError

I'll also attach cmd & streamlit detail for you: Streamlit _ERROR_MSG cmd history.txt

mmz-001 commented 1 year ago

Looks like somethings wrong with the Python virtual environment. Can you install the openai package without using Poetry and see if it works? Other than that you can try creating the virtual environment manually by first deleting the .venv folder then creating it with Python:

python -m venv .venv

and try installing the dependencies with Poetry.