I have made a Flask app, tested it on a local server and it works fine. Rented a server from Linode and wanted to deploy it there but ran into problems. Created a virtual environment just like I did on my computer, but the python version is 3.7.3 instead of 3.10.6. The langchain version is 0.0.27. These are the imports I need:
from flask import Flask, render_template, request
import openai
import pinecone
import json
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.chains.question_answering import load_qa_chain
from langchain.llms import OpenAI
from langchain.vectorstores import Pinecone
import os
but when I run the app I get the error from langchain.chains.question_answering import load_qa_chain ModuleNotFoundError: No module named 'langchain.chains.question_answering'. Any help would be appriciated.
I have tried to update python and langchain, restart the server, delete the server and set up a new one, delete the venv and uninstall both langchain and python but to no avail. These are the libraries in my venv
pip list
Package Version
------------------ ---------
aiohttp 3.8.5
aiosignal 1.3.1
annotated-types 0.5.0
async-timeout 4.0.2
asynctest 0.13.0
attrs 23.1.0
certifi 2023.7.22
charset-normalizer 3.2.0
click 8.1.6
dnspython 2.3.0
Flask 2.2.5
frozenlist 1.3.3
greenlet 2.0.2
gunicorn 21.2.0
idna 3.4
importlib-metadata 6.7.0
itsdangerous 2.1.2
Jinja2 3.1.2
langchain 0.0.27
loguru 0.7.0
MarkupSafe 2.1.3
multidict 6.0.4
numpy 1.21.6
openai 0.27.8
packaging 23.1
pinecone-client 2.2.1
pip 23.2.1
pkg_resources 0.0.0
pydantic 1.10.9
pydantic_core 2.3.0
python-dateutil 2.8.2
PyYAML 6.0.1
requests 2.31.0
setuptools 68.0.0
six 1.16.0
SQLAlchemy 2.0.19
tqdm 4.65.0
typing_extensions 4.7.1
urllib3 2.0.4
Werkzeug 2.2.3
yarl 1.9.2
zipp 3.15.0