Closed RLashofRegas closed 2 months ago
Hey,
When you install awswrangler, make sure to include the opensearch
extra:
pip install --upgrade awswrangler[opensearch]
When you use that extra parameter, pip will also install opensearch-py
, jsonpath-ng
, and requests-aws4auth
, which are the three additional libraries we need to support OpenSearch.
From the logs you included, it looks like your original environment included opensearch-py
but not jsonpath-ng
. Then, when you installed the 2.x.x version of awswrangler
, it came included with all the OpenSearch dependencies. The reason for this is that starting with 3.0.0, we decided to keep the list of dependencies we install by default to a bare minimum. So OpenSearch went from being a regular dependency to an optional dependency. More information on why we made this decision is available here.
Let me know if adding the extra parameter to the pip install
works for you.
Best regards, Leon
I also created #2939 so that a more sensible error is thrown in the future.
Hmmm, this still seems like an issue to me. What if I am using opensearch-py
for some things, but not the awswrangler
opensearch extensions. The following fails:
virtualenv --python="/Library/Frameworks/Python.framework/Versions/3.11/bin/python3" .venv
source .venv/bin/activate
pip install --upgrade pip
pip install --upgrade opensearch-py
pip install --upgrade awswrangler
python
>>> import awswrangler
You still need the jsonpath-ng
and requests-aws4auth
dependencies. When you run pip install awswrangler[opensearch]
, all of this is installed automatically.
Alternatively, you can install them manually:
pip install --upgrade opensearch-py jsonpath-ng requests-aws4auth
pip install --upgrade awswrangler
I don't need those. I am using opensearch-py
directly in other parts of my project and then using awswrangler.s3
methods NOT the opensearch methods. import opensearchpy
works fine with the above setup. So what I'm saying is that just because I installed opensearch-py
in my environment for unrelated code, shouldn't break awswrangler
.
Gotcha, sorry about the misunderstanding.
The PR that I created (#2939) should fix this once it’s merged and released. In the meantime, the easiest way to work around this is to install jsonpath-ng
.
Describe the bug
I am on an M1 mac. When I install any 3.x version of
awswrangler
and thenimport awswrangler as wr
it fails with the error:How to Reproduce
If I install 2.20.1 it works. Here's the output of
pip install awswrangler==2.20.1
:Importing the module after this works.
Here's the output after first running
pip uninstall jsonpath-ng
and then runningpip install --upgrade awswrangler
After this the import fails.
Expected behavior
after running
pip install awswrangler
,import awswrangler
should work.Your project
No response
Screenshots
No response
OS
M1 Pro Mac, Mac OS Sonoma 14.6.1
Python version
3.11.9
AWS SDK for pandas version
3.9.1 (and all 3.x releases)
Additional context
No response