deepdiff
deepdiff copied to clipboard
Unable to import numpy in deepdiff/distance.py
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
- Launch a Python3 interpreter in a virtual env that has
deepdiffset up. - Run
from deepdiff import DeepDiff
Expected behavior Import should run successfully.
OS, DeepDiff version and Python version (please complete the following information):
- OS: MacOS
- Version Sonoma 14.5
- Python Version 3.11.8
- DeepDiff Version 8.0.0
Additional context The breaking change is most likely this PR. This issue does not exist in the v.7.0.1 release.
same from azure cli diff tool
Seeing this too, broke my test pipelines :)
Thanks for reporting. Let me fix it.
@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.
@seperman thank you so much for the fix! v8.0.1 works like a charm 👍
You are welcome!