langchain-ai / langchain

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

Geopandas and Langchain blocking issue. #16156

Closed k-a-mendoza closed 5 months ago

k-a-mendoza commented 8 months ago

Checked other resources

Example Code

The bug was found by trying to install jupyter-ai via conda-forge. install -c conda-forge jupyter_ai

Basically, there is an incompatibility with the latest version of langchain and geopandas.

Description

Based on the bug report posted on the jupyter-ai github https://github.com/jupyterlab/jupyter-ai/issues/557#issue-2062998660 , it looks like langchain enforces a version of geopandas below 0.14. Could this be relaxed to allow for >0.14? There are many features of modern geopandas that make GIS workflows so much easier, and the current enforcement version prevents langchain-dependent repositories from making full use of GIS-adjacent stacks.

System Info

The incompatibility arose while using an M1 apple silicon laptop.

Related Components

dosubot[bot] commented 8 months ago

🤖

Hello @k-a-mendoza! I'm Dosu, a friendly bot here to assist you with bugs and questions while you're waiting for a human maintainer. I'm here to make your journey with LangChain smoother. Let's get started!

Thank you for bringing this to our attention. The version constraint of geopandas in LangChain can indeed be relaxed to allow for versions greater than 0.14. This can be achieved by modifying the version constraint in the pyproject.toml file.

Currently, the version constraint for geopandas is set to "^0.13.1", which means any version greater or equal to 0.13.1 and less than 0.14.0 is allowed. To allow versions greater than 0.14, you can change the version constraint to "^0.14".

Here is the modified line in the pyproject.toml file:

geopandas = {version = "^0.14", optional = true}

This change will allow geopandas versions greater or equal to 0.14 and less than 1.0. If you want to allow any version greater than 0.14 without any upper limit, you can use the ">=" operator like so:

geopandas = {version = ">=0.14", optional = true}

Please note that relaxing the version constraint might lead to compatibility issues with other packages or parts of the LangChain framework that rely on specific features or behaviors of geopandas 0.13.1. Therefore, it's recommended to thoroughly test the framework after making this change.

As for the specific reason for the current version constraint of geopandas in the LangChain codebase, I wasn't able to find an answer within the repository. It's possible that the answer may be available elsewhere or I could have missed it.

I hope this helps! If you have any other questions or need further clarification, please don't hesitate to ask.

Best, Dosu

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

scottyhq commented 2 months ago

Hi! Just wanted to reopen this one because Geopandas 1.0 has been out since June 24. It would be great to set 1.0 as the minimum version

https://github.com/geopandas/geopandas/releases/tag/v1.0.0