Issue with Version Conflicts While Upgrading to Gemini 2.5 (Google Generative AI & LangChain) I am switching to Gemini 2.5 Experimental from Gemini 1.5 and trying to upgrade the versions of google-ai-generativelanguage and google-generativeai to support Gemini 2.5.
I am using a requirements.txt file to manage dependencies, but due to version conflicts, I am unable to install the dependencies properly.
I tried using:
google-ai-generativelanguage==0.6.15
google-generativeai==0.8.4
However, these versions are not compatible with my current langchain version.
Issue When I install my requirements.txt, I get dependency conflicts between langchain, google-ai-generativelanguage, and google-generativeai.
Current requirements.txt
Flask==3.0.3
Flask-Cors==4.0.1
frozenlist==1.4.1
google-ai-generativelanguage==0.6.5
google-api-core==2.19.0
google-api-python-client==2.131.0
google-auth==2.29.0
google-auth-httplib2==0.2.0
google-cloud-core==2.4.1
google-cloud-firestore==2.16.0
google-cloud-storage==2.16.0
google-crc32c==1.5.0
google-generativeai==0.7.0
google-resumable-media==2.7.0
googleapis-common-protos==1.63.1
grpcio==1.64.0
grpcio-status==1.62.2
gunicorn==22.0.0
h11==0.14.0
httpcore==1.0.5
httplib2==0.22.0
httpx==0.27.0
idna==3.7
importlib_metadata==7.1.0
itsdangerous==2.2.0
Jinja2==3.1.4
jmespath==1.0.1
jsonpatch==1.33
jsonpointer==3.0.0
langchain==0.2.6
langchain-community==0.2.6
langchain-core==0.2.10
langchain-google-genai==1.0.7
langchain-text-splitters==0.2.2
langsmith==0.1.82
MarkupSafe==2.1.5
marshmallow==3.21.3
msgpack==1.0.8
multidict==6.0.5
stripe==6.0.0
mypy-extensions==1.0.0
numpy==1.26.4
openai==0.28.0
orjson==3.10.5
packaging==24.1
pathspec==0.10.1
pipenv==2023.12.1
platformdirs==4.2.2
proto-plus==1.23.0
protobuf==4.25.3
pyasn1==0.6.0
pyasn1_modules==0.4.0
pycparser==2.22
pydantic==2.7.3
pydantic_core==2.18.4
PyJWT==2.8.0
pyparsing==3.1.2
PyPDF2==3.0.1
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
PyYAML==6.0.1
requests==2.32.3
rsa==4.9
semantic-version==2.8.5
six==1.16.0
sniffio==1.3.1
SQLAlchemy==2.0.31
tenacity==8.4.2
termcolor==1.1.0
tqdm==4.66.4
typing-inspect==0.9.0
typing_extensions==4.12.1
uritemplate==4.1.1
urllib3==1.26.18
virtualenv==20.26.2
wcwidth==0.1.9
Werkzeug==3.0.3
yarl==1.9.4
zipp==3.19.1
joblib==1.3.2```
Issue with Version Conflicts While Upgrading to Gemini 2.5 (Google Generative AI & LangChain) I am switching to Gemini 2.5 Experimental from Gemini 1.5 and trying to upgrade the versions of google-ai-generativelanguage and google-generativeai to support Gemini 2.5.
I am using a requirements.txt file to manage dependencies, but due to version conflicts, I am unable to install the dependencies properly.
I tried using:
google-ai-generativelanguage==0.6.15
google-generativeai==0.8.4
However, these versions are not compatible with my current langchain version.
Issue When I install my requirements.txt, I get dependency conflicts between langchain, google-ai-generativelanguage, and google-generativeai.
Current requirements.txt
Flask==3.0.3
Flask-Cors==4.0.1
frozenlist==1.4.1
google-ai-generativelanguage==0.6.5
google-api-core==2.19.0
google-api-python-client==2.131.0
google-auth==2.29.0
google-auth-httplib2==0.2.0
google-cloud-core==2.4.1
google-cloud-firestore==2.16.0
google-cloud-storage==2.16.0
google-crc32c==1.5.0
google-generativeai==0.7.0
google-resumable-media==2.7.0
googleapis-common-protos==1.63.1
grpcio==1.64.0
grpcio-status==1.62.2
gunicorn==22.0.0
h11==0.14.0
httpcore==1.0.5
httplib2==0.22.0
httpx==0.27.0
idna==3.7
importlib_metadata==7.1.0
itsdangerous==2.2.0
Jinja2==3.1.4
jmespath==1.0.1
jsonpatch==1.33
jsonpointer==3.0.0
langchain==0.2.6
langchain-community==0.2.6
langchain-core==0.2.10
langchain-google-genai==1.0.7
langchain-text-splitters==0.2.2
langsmith==0.1.82
MarkupSafe==2.1.5
marshmallow==3.21.3
msgpack==1.0.8
multidict==6.0.5
stripe==6.0.0
mypy-extensions==1.0.0
numpy==1.26.4
openai==0.28.0
orjson==3.10.5
packaging==24.1
pathspec==0.10.1
pipenv==2023.12.1
platformdirs==4.2.2
proto-plus==1.23.0
protobuf==4.25.3
pyasn1==0.6.0
pyasn1_modules==0.4.0
pycparser==2.22
pydantic==2.7.3
pydantic_core==2.18.4
PyJWT==2.8.0
pyparsing==3.1.2
PyPDF2==3.0.1
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
PyYAML==6.0.1
requests==2.32.3
rsa==4.9
semantic-version==2.8.5
six==1.16.0
sniffio==1.3.1
SQLAlchemy==2.0.31
tenacity==8.4.2
termcolor==1.1.0
tqdm==4.66.4
typing-inspect==0.9.0
typing_extensions==4.12.1
uritemplate==4.1.1
urllib3==1.26.18
virtualenv==20.26.2
wcwidth==0.1.9
Werkzeug==3.0.3
yarl==1.9.4
zipp==3.19.1
joblib==1.3.2```
Share
Improve this question
asked Mar 31 at 16:56
Surasani SivaSurasani Siva
111 bronze badge
New contributor
Surasani Siva is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2
- 3 why not relax the absolute versions and let pip try to figure out a working combo for you? – JonSG Commented Mar 31 at 17:20
- Also you have not provided an actual error message. Please edit your question and include a minimal reproducible example so other users can reproduce your problem. – dev_light Commented Mar 31 at 17:27
1 Answer
Reset to default 1Starting with Gemini 1.5 and Gemini 2.0, you should use Google Gen AI SDK, which provides a unified interface to Gemini 2.0 and 1.5 (and should be for Gemini 2.5 when GA) through both the Gemini Developer API and the Gemini API on Vertex AI. So, you just need: google-genai (version 1.7.0 as of now). You no longer need google-ai-generativelanguage
.
I tested the latest google-genai
with lanchain modules, seems installing fine.
langchain==0.2.6
langchain-community==0.2.6
langchain-core==0.2.10
langchain-google-genai==1.0.7
langchain-text-splitters==0.2.2
langsmith==0.1.82
google-genai==1.7.0
Please review the Google Gen AI SDK documentation for detail.