langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
93.09k stars 14.97k forks source link

Can only install langchain==0.0.27 #1475

Closed HansiZeng closed 11 months ago

HansiZeng commented 1 year ago

I have installed langchain using pip install langchain in the Google VertexAI notebook, but I was only able to install version 0.0.27. I wanted to install a more recent version of the package, but it seems that it is not available.

Here are the installation details for your reference:

Collecting langchain
  Using cached langchain-0.0.27-py3-none-any.whl (124 kB)
Requirement already satisfied: numpy in /opt/conda/lib/python3.7/site-packages (from langchain) (1.19.5)
Requirement already satisfied: pyyaml in /opt/conda/lib/python3.7/site-packages (from langchain) (6.0)
Requirement already satisfied: pydantic in /opt/conda/lib/python3.7/site-packages (from langchain) (1.7.4)
Requirement already satisfied: sqlalchemy in /opt/conda/lib/python3.7/site-packages (from langchain) (1.4.36)
Requirement already satisfied: requests in /opt/conda/lib/python3.7/site-packages (from langchain) (2.28.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/conda/lib/python3.7/site-packages (from requests->langchain) (1.26.12)
Requirement already satisfied: charset-normalizer<3,>=2 in /opt/conda/lib/python3.7/site-packages (from requests->langchain) (2.1.1)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.7/site-packages (from requests->langchain) (2022.9.24)
Requirement already satisfied: idna<4,>=2.5 in /opt/conda/lib/python3.7/site-packages (from requests->langchain) (3.4)
Requirement already satisfied: importlib-metadata in /opt/conda/lib/python3.7/site-packages (from sqlalchemy->langchain) (5.0.0)
Requirement already satisfied: greenlet!=0.4.17 in /opt/conda/lib/python3.7/site-packages (from sqlalchemy->langchain) (1.1.2)
Requirement already satisfied: zipp>=0.5 in /opt/conda/lib/python3.7/site-packages (from importlib-metadata->sqlalchemy->langchain) (3.10.0)
Requirement already satisfied: typing-extensions>=3.6.4 in /opt/conda/lib/python3.7/site-packages (from importlib-metadata->sqlalchemy->langchain) (4.4.0)
Installing collected packages: langchain
Successfully installed langchain-0.0.27

If you know more information, don't hesitate to contact me.

HansiZeng commented 1 year ago

If I tried to install a higher version, for example, using the command pip install langchain==0.0.88. The specific version is not available and the error output is in the following:


ERROR: Could not find a version that satisfies the requirement langchain==0.0.88 (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.7, 0.0.8, 0.0.9, 0.0.10, 0.0.11, 0.0.12, 0.0.13, 0.0.14, 0.0.15, 0.0.16, 0.0.17, 0.0.18, 0.0.19, 0.0.20, 0.0.21, 0.0.22, 0.0.23, 0.0.24, 0.0.25, 0.0.26, 0.0.27)
ERROR: No matching distribution found for langchain==0.0.88```
AlpriElse commented 1 year ago

What version of python are you running?

Newer versions of langchain eg. langchain 0.0.102 needs a python version >= 3.8.1

jnorris441 commented 1 year ago

I had this...you should try pip install --upgrade langchain to get the newest version

SchlackBoles commented 1 year ago

I am on a Linode server and I have this version of Langchain: langchain 0.0.27 and this version of Python: python 3.7.3. I get this error when I try to run my Flask app: from langchain.chat_models import ChatOpenAI ModuleNotFoundError: No module named 'langchain.chat_models'

I have tried the pip install --upgrade langchain but to no avail and I am running out of ideas.

kenn commented 1 year ago

Likely you are using SQLAlchemy 2

https://github.com/langchain-ai/langchain/issues/1272#issuecomment-1474790116

SchlackBoles commented 1 year ago

Deleted the virtual environment that was installed by default and installed python 3.10.6 manually. Used this version to create the new venv and now it works. I think the problem was that langchain.chat_models was not in the langchain module (at least it was not listed) as you need python 3.8.x or higher to get it.

dosubot[bot] commented 11 months ago

Hi, @HansiZeng! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

Based on the information provided, it seems that you were experiencing difficulties installing a higher version of the langchain package. AlpriElse mentioned that newer versions of langchain require Python version 3.8.1 or higher, and jnorris441 suggested using pip install --upgrade langchain to get the newest version. SchlackBoles resolved the issue by manually installing Python 3.10.6 and creating a new virtual environment.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your understanding and contribution to the LangChain project!