seperman / deepdiff

DeepDiff: Deep Difference and search of any Python object/data. DeepHash: Hash of any object based on its contents. Delta: Use deltas to reconstruct objects by adding deltas together.
http://zepworks.com
Other
2.03k stars 224 forks source link

Unable to import numpy in deepdiff/distance.py #478

Closed terry-chiu-certn closed 2 months ago

terry-chiu-certn commented 2 months ago

Describe the bug This is a build issue where importing deepdiff.DeepDiff results in:

...
    from deepdiff import DeepDiff
venv/lib/python3.11/site-packages/deepdiff/__init__.py:10: in <module>
    from .diff import DeepDiff
venv/lib/python3.11/site-packages/deepdiff/diff.py:30: in <module>
    from deepdiff.distance import DistanceMixin, logarithmic_similarity
venv/lib/python3.11/site-packages/deepdiff/distance.py:1: in <module>
    import numpy as np
E   ModuleNotFoundError: No module named 'numpy'

To Reproduce

  1. Launch a Python3 interpreter in a virtual env that has deepdiff set up.
  2. Run from deepdiff import DeepDiff

Expected behavior Import should run successfully.

OS, DeepDiff version and Python version (please complete the following information):

Additional context The breaking change is most likely this PR. This issue does not exist in the v.7.0.1 release.

AllyW commented 2 months ago

same from azure cli diff tool

jonaswerme commented 2 months ago

Seeing this too, broke my test pipelines :)

seperman commented 2 months ago

Thanks for reporting. Let me fix it.

seperman commented 2 months ago

@jonaswerme @AllyW @terry-chiu-certn @mellon85 DeepDiff 8.0.1 is released with a bugfix. There was an extra import of Numpy that was causing this issue.

terry-chiu-certn commented 2 months ago

@seperman thank you so much for the fix! v8.0.1 works like a charm 👍

seperman commented 2 months ago

You are welcome!