I am new to Python and coding generally, and I cannot figure out how to set up a debugger that will work with Arcpy. I am trying to use PyCharm, but it always gets caught up with the fact that it can't actually open ArcMap. It gives me this error when I run in the IDE:
RuntimeError: Object: CreateObject cannot open map document.
I run the scripts from a Toolbox and they don't run correctly. All I know how to do is comment out some lines and narrow the problem down by re-running. There's got to be a better way. Right?