Hey, I started getting this warning when adding t...
# general
s
Hey, I started getting this warning when adding the
langchain-google-vertexai
library - is there something I can do to fix this in my project, or would google need to fix it? Currently hiding it via
emit_warnings=False
on the
pex_binary
target, but not sure if that's a good long term strategy or not
Looks like this didn't actually work
Copy code
/root/Library/Caches/pex/unzipped_pexes/0/c31c49cf1f2140165315f7e697e32b6b286fadd4/.bootstrap/pex/environment.py:766: PEXWarning: The `pkg_resources` package was loaded from a pex vendored version when declaring namespace packages defined by:

1. google-cloud-aiplatform==1.86.0 namespace packages:
  google
  google.cloud

These distributions should fix their `install_requires` to include `setuptools`
  pex_warnings.warn(
h
Sounds like that library depends on
setuptools
(via their namespace package decls) but doesn’t explicitly declare that dependency. Try adding an explicit dep from the
python_requirement
onto
setuptools
. Something like:
Copy code
python_requirement(
  name="langchain-google-vertexai",
  requirements=["langchain-google-vertexai==1.2.3"],
  dependencies=["path/to/reqs#setuptools"],
)
Or if you want to keep
langchain-google-vertexai
in your requirements.txt you can probably do this with
overrides
to override the dep for just this requirement
s
Ooohh I see! I guess I need to add setuptools to requirements.txt as well?
h
Yes, definitely, if you don’t already have it
s
Cool, i'll give this a go - thank you very much!
h
But really this is just working around a broken distribution
Google has a long history of bad Python hygiene
s
I was wondering if that might be the case