2

I debug a project and I get a scary warning somewhere in it:

../opt/anaconda3/envs/myenv/lib/python3.6/site-packages/numpy/core/_methods.py:26: RuntimeWarning: invalid value encountered in reduce
  return umr_maximum(a, axis, None, out, keepdims)

Pycharm allows to stop at a exception through setting exception breakpoint, as document says. I tried and it didn't work for warning (I assume warning is not Exception)!

Is there a way for me to stop when this warning raises and see what's going on?

3
  • you can turn warnings into errors by setting PYTHONWARNINGS=error (environment variable) or -W error on the commandline (if you have access to that) Commented Aug 5, 2021 at 3:23
  • Thanks a lot @AnthonySottile . And how can I revert it back?! If I couldn't resolve it I don't want to be hindered by it! I think I found the solution [stackoverflow.com/questions/6877727/…. Thanks! Commented Aug 5, 2021 at 3:41
  • undo whatever you did? Commented Aug 5, 2021 at 12:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.