Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Pin unpinned dependencies. #6

Merged
merged 1 commit into from
Jun 18, 2024
Merged

Conversation

JosephCatrambone
Copy link
Contributor

On 2024/06/16, numpy released 2.0.0. Congratulations to them. Some child dependencies of the PII detector did not pin dependencies, thus leading to the following error on install:

guardrails hub install hub://guardrails/detect_pii
Installing hub://guardrails/detect_pii...
[=   ] Downloading dependencies  Running command git clone --filter=blob:none --quiet https://github.com/guardrails-ai/detect_pii.git /private/var/folders/99/9myytxhs0kd2bx81qgc4bl0c0000gn/T/pip-req-build-qdso3or7
[====] Running post-install setupTraceback (most recent call last):
  File "/Users/josephcatrambone/.virtualenvs/debug_detect_pii/lib/python3.10/site-packages/guardrails/hub/guardrails/detect_pii/validator/post-install.py", line 1, in <module>
    from presidio_analyzer import AnalyzerEngine
  File "/Users/josephcatrambone/.virtualenvs/debug_detect_pii/lib/python3.10/site-packages/presidio_analyzer/__init__.py", line 9, in <module>
    from presidio_analyzer.entity_recognizer import EntityRecognizer
  File "/Users/josephcatrambone/.virtualenvs/debug_detect_pii/lib/python3.10/site-packages/presidio_analyzer/entity_recognizer.py", line 6, in <module>
    from presidio_analyzer.nlp_engine import NlpArtifacts
  File "/Users/josephcatrambone/.virtualenvs/debug_detect_pii/lib/python3.10/site-packages/presidio_analyzer/nlp_engine/__init__.py", line 4, in <module>
    from .nlp_artifacts import NlpArtifacts
  File "/Users/josephcatrambone/.virtualenvs/debug_detect_pii/lib/python3.10/site-packages/presidio_analyzer/nlp_engine/nlp_artifacts.py", line 4, in <module>
    from spacy.tokens import Doc, Span
  File "/Users/josephcatrambone/.virtualenvs/debug_detect_pii/lib/python3.10/site-packages/spacy/__init__.py", line 6, in <module>
    from .errors import setup_default_warnings
  File "/Users/josephcatrambone/.virtualenvs/debug_detect_pii/lib/python3.10/site-packages/spacy/errors.py", line 3, in <module>
    from .compat import Literal
  File "/Users/josephcatrambone/.virtualenvs/debug_detect_pii/lib/python3.10/site-packages/spacy/compat.py", line 39, in <module>
    from thinc.api import Optimizer  # noqa: F401
  File "/Users/josephcatrambone/.virtualenvs/debug_detect_pii/lib/python3.10/site-packages/thinc/api.py", line 1, in <module>
    from .backends import (
  File "/Users/josephcatrambone/.virtualenvs/debug_detect_pii/lib/python3.10/site-packages/thinc/backends/__init__.py", line 17, in <module>
    from .cupy_ops import CupyOps
  File "/Users/josephcatrambone/.virtualenvs/debug_detect_pii/lib/python3.10/site-packages/thinc/backends/cupy_ops.py", line 16, in <module>
    from .numpy_ops import NumpyOps
  File "thinc/backends/numpy_ops.pyx", line 1, in init thinc.backends.numpy_ops
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
Failed to run post install script for guardrails/detect_pii
Exit code: 1
stdout: b''

It is a known error on presidio: microsoft/presidio#1400

This works around the issue.

@CalebCourier CalebCourier merged commit b4e4be2 into main Jun 18, 2024
"presidio-anonymizer",
"presidio-analyzer==2.2.354",
"presidio-anonymizer==2.2.354",
"numpy==1.26.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinning to the exact version (e.g. for numpy) may cause incompatibilities in the dev env -- it's probably more flexible to pin to a max version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants