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

6.4.0 importing deepdiff results in none type error #416

Closed
jamespilcher opened this issue Sep 1, 2023 · 5 comments
Closed

6.4.0 importing deepdiff results in none type error #416

jamespilcher opened this issue Sep 1, 2023 · 5 comments

Comments

@jamespilcher
Copy link

jamespilcher commented Sep 1, 2023

Getting the following error in CI:

test_file.py:8: in <module>
    from deepdiff import DeepDiff
/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/deepdiff/__init__.py:10: in <module>
    from .diff import DeepDiff
/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/deepdiff/diff.py:19: in <module>
    from deepdiff.helper import (strings, bytes_type, numbers, uuids, datetimes, ListItemRemovedOrAdded, notpresent,
/opt/hostedtoolcache/Python/3.10.12/x64/lib/python3.10/site-packages/deepdiff/helper.py:158: in <module>
    if get_semvar_as_integer(np.__version__) < 1019000:
E   AttributeError: 'NoneType' object has no attribute '__version__'

OS: Ubuntu 22.0.4 LTS
Python Version: 3.10.12
DeepDiff Version 6.4.0

Additional context
Failing to import numpy as np, so np is set to None by the try except
https://github.com/seperman/deepdiff/blob/master/deepdiff/helper.py

softwarefactory-project-zuul bot added a commit to packit/packit-service that referenced this issue Sep 1, 2023
Temporarily lock deepdiff version to fix CI failures

See: seperman/deepdiff#416

Reviewed-by: Maja Massarini
softwarefactory-project-zuul bot added a commit to packit/packit that referenced this issue Sep 1, 2023
Temporarily lock deepdiff version to fix CI failures

See: seperman/deepdiff#416

Reviewed-by: Maja Massarini
@daxm
Copy link

daxm commented Sep 1, 2023

I have the same issue. v6.3.1 worked/works fine but v6.4.0 gives error:

webserver      | Traceback (most recent call last):
webserver      |   File "/app/webserver.py", line 2, in <module>
webserver      |     import run_actions
webserver      |   File "/app/run_actions.py", line 13, in <module>
webserver      |     import actions
webserver      |   File "/app/actions/__init__.py", line 1, in <module>
webserver      |     from actions.api_basics import ApiBasics
webserver      |   File "/app/actions/api_basics.py", line 4, in <module>
webserver      |     from .zs4u_essentials import Zs4uEssentials
webserver      |   File "/app/actions/zs4u_essentials.py", line 8, in <module>
webserver      |     from .scorch_the_earth import ScorchTheEarth
webserver      |   File "/app/actions/scorch_the_earth.py", line 4, in <module>
webserver      |     from deepdiff import DeepDiff
webserver      |   File "/usr/local/lib/python3.11/site-packages/deepdiff/__init__.py", line 10, in <module>
webserver      |     from .diff import DeepDiff
webserver      |   File "/usr/local/lib/python3.11/site-packages/deepdiff/diff.py", line 19, in <module>
webserver      |     from deepdiff.helper import (strings, bytes_type, numbers, uuids, datetimes, ListItemRemovedOrAdded, notpresent,
webserver      |   File "/usr/local/lib/python3.11/site-packages/deepdiff/helper.py", line 158, in <module>
webserver      |     if get_semvar_as_integer(np.__version__) < 1019000:
webserver      |                              ^^^^^^^^^^^^^^
webserver      | AttributeError: 'NoneType' object has no attribute '__version__'
webserver exited with code 1

I'm running it in a Docker container named "webserver" and these are the docker-compose logs output.

@seperman
Copy link
Owner

seperman commented Sep 1, 2023 via email

@seperman
Copy link
Owner

seperman commented Sep 1, 2023

Hello, thanks for reporting the issue.
Please upgrade to DeepDiff 6.4.1.

@seperman seperman closed this as completed Sep 1, 2023
@daxm
Copy link

daxm commented Sep 1, 2023

Tested. My code runs successfully on v6.4.1.

@XDanny322
Copy link

Thanks, all seems to be fixed in 6.4.1 as well.

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

No branches or pull requests

4 participants