Breakpoints not hitting

Answered

I'm not sure if this is related to one of the other debugger problems or not, but it doesn't seem similar.  And all of this was working before I upgraded PyCharm to 

PyCharm 2018.2.4 (Professional Edition)
Build #PY-182.4505.26, built on September 19, 2018
Licensed to Kevin D McKenzie
Subscription is active until April 10, 2019
JRE: 1.8.0_152-release-1248-b8 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.1

(and possibly Mac OS to 10.14; I don't know if that's related or not).

 

Anyway, I have a working configuration, I set breakpoints, and hit the debug button.  The console says

/Users/kdm/.virtualenvs/current_tracker-e-AzFSGN/bin/python /Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py --module --multiproc --qt-support=auto --client 127.0.0.1 --port 52954 --file flask test --xml --coverage
pydev debugger: process 21582 is connecting

Connected to pydev debugger (build 182.4505.26)
pydev debugger: process 21582 is connecting

...


Process finished with exit code 0


and then logging information from my program. I have print statements in at the breakpoints, and I do see those print statements being generated, so it is passing through the breakpoints, it just doesn't stop at them.
0
8 comments

Hi Kdm,

Could you please set PYCHARM_DEBUG=True environment variable in the run configuration, debug and provide the console output here?

0
Avatar
Permanently deleted user

With that specified, it works.  (Note I'm also having some issues with the flask server run configuration that may be related to this).  However, shouldn't that be specified automatically when I enable the debugger?  I didn't find any reference to PYCHARM_DEBUG in the documentation, so I hadn't set it before.

0

Setting this variable should not fix anything, it only provides more details to the log and output for investigation. So, probably there was something else.

>Note I'm also having some issues with the flask server run configuration that may be related to this

What kind of issues? Please attach a screenshot showing it.

0
Avatar
Permanently deleted user

Setting the variable may not be supposed to fix anything, but it does.  I'm using something based off of Flasky, by Michael Grinberg.  The configuration looks like this:


It appears that the flask configuration issues "flask run" underneath the covers, so I ended up having to choose a custom configuration with no options; all of my attempts to use either a module name or script path ended up with weird errors, which is partly why I was trying to use the debugger in the first place.

 

And you were right; specifying PYCHARM_DEBUG=TRUE didn't make a difference; it does appear to be working properly both ways now that I got the flask configuration defined properly.

0

>all of my attempts to use either a module name or script path ended up with weird errors, which is partly why I was trying to use the debugger in the first place.

Could you please provide a screenshot showing these errors?

Does it work with a new project following the tutorial https://www.jetbrains.com/help/pycharm/creating-flask-project.html?

0

Resolved for my after removing Coverage from pytests

0
Avatar
Permanently deleted user

Removing coverage definitely helps, but why do we need to?  Is it a bug ?

0

Please sign in to leave a comment.