unstructured icon indicating copy to clipboard operation
unstructured copied to clipboard

improve: add Python 3.12 support

Open nicoloboschi opened this issue 1 year ago • 3 comments

Draft: currently blocked by argilla not supporting 3.12 Waiting for this PR to be released: https://github.com/argilla-io/argilla/pull/4837

Fixes #2959

nicoloboschi avatar May 16 '24 00:05 nicoloboschi

Thanks for this @nicoloboschi ! Just turned on the CI pipeline. If I recall correctly, it was onnx that was blocking 3.12 support before, but that should be resolved now.

MthwRobinson avatar May 16 '24 15:05 MthwRobinson

CI failure was due to this. We may be able to work around that though.

ERROR: Cannot install argilla==1.28.0 because these package versions have conflicting dependencies.

The conflict is caused by:
    argilla 1.28.0 depends on numpy<1.24.0
    The user requested (constraint) numpy>=1.26.0
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

MthwRobinson avatar May 16 '24 15:05 MthwRobinson

Ahh disregard, I see you have a PR open for 3.12 support in Argilla as well.

MthwRobinson avatar May 16 '24 15:05 MthwRobinson

@MthwRobinson hi I experience the below error with onnx when trying to use python 3.12 with unstructured ImportError: dlopen(/Users/gokturkdev/PycharmProjects/hekades-backend/venv/lib/python3.12/site-packages/onnx/onnx_cpp2py_export.cpython-312-darwin.so, 0x0002): symbol not found in flat namespace '__ZN6google8protobuf2io16CodedInputStream24default_recursion_limit_E'

I reckon its due to python support then. When can I expect this PR to be released? I really don't want to downgrade my entire app for this

gokturkDev avatar May 17 '24 12:05 gokturkDev

Meanwhile are there any hotfixes I can apply?

gokturkDev avatar May 17 '24 12:05 gokturkDev

@gokturkDev - In the meantime, I'd try manually running make install on the branch for this PR. The version updates @nicoloboschi added to contraints.txt are what you need to enable 3.12. As long as you aren't using the Argilla integration I don't think it should be an issue, though I haven't tested it myself yet.

MthwRobinson avatar May 17 '24 12:05 MthwRobinson

Hey thanks for the response. I ended up installing the latest onnx manually instead of using the one installed as an unstructured dependency and its working so far 👍

gokturkDev avatar May 17 '24 12:05 gokturkDev

@nicoloboschi - Going to merge this into a feature branch and then get it into main from there. Failing tests are because env vars are missing on the fork. Thank you for this contribution!

MthwRobinson avatar May 17 '24 16:05 MthwRobinson

New PR is #3047

MthwRobinson avatar May 17 '24 16:05 MthwRobinson