cknd / stackprinter

Debugging-friendly exceptions for Python
MIT License
1.28k stars 37 forks source link

No module named 'packaging' #59

Closed alx-sdv closed 1 year ago

alx-sdv commented 1 year ago

Import fails since #57 setuptools.find_packages() can't obtain packaging

Steps to reproduce: docker run -it python:3.9-slim /bin/bash -c "pip install numpy stackprinter && python -c 'import stackprinter'"

cknd commented 1 year ago

Interesting - installing stackprinter alone works fine (so docker run -it python:3.9-slim /bin/bash -c "pip install stackprinter && python -c 'import stackprinter'"), but it fails alongside numpy 🤔

alx-sdv commented 1 year ago

Interesting - installing stackprinter alone works fine (so docker run -it python:3.9-slim /bin/bash -c "pip install stackprinter && python -c 'import stackprinter'"), but it fails alongside numpy thinking

It happens because packaging is imported only if the environment contains numpy. So I think it affects any environment containing numpy and unpinned stackprinter. Imho, more preferable solution is to implement np version checking and don't add packaging dependency.

cknd commented 1 year ago

Ah of course! Thanks a lot. I'll get rid of the version check entirely, this case should've just been handled with an exception handler from the start. I'll close this PR and will push a fix soon - thanks a lot for the report!

cknd commented 1 year ago

Fixed in 0.2.10