ipdb: RuntimeWarning: 'ipdb.__main__' found in sys.modules after import of package 'ipdb'
Asked Answered
W

0

7

I am using ipdb to debug my python like below:

python -m ipdb my_test.py -d my_input_config -o my_output

and got the following errors:

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py:125: RuntimeWarning: 'ipdb.__main__' found in sys.modules after import of package 'ipdb', but prior to execution of 'ipdb.__main__'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))

What does this mean and how do I fix this? Thank you!

Wadi answered 21/3, 2019 at 18:1 Comment(3)
see herePacific
https://mcmap.net/q/367954/-python-multiprocessing-error-attributeerror-module-39-__main__-39-has-no-attribute-39-__spec__-39 This might be usefulInigo
Typing __spec__ = None as soon as ipdb starts up seems to solve the "unpredictable" behavior (like the link above says) but it'd be nice to know why this happens and how to solve it without that workaround.Monolatry

© 2022 - 2024 — McMap. All rights reserved.