PyCharm debugger 1 - Me 0

Dev environment:

  • Mac 10.14.6
  • PyCharm Community 2019.2
  • python 2.7.10
  • pip 19.2.2
  • virtualenv 16.7.2
  • Latest code from maintenance branch

Things used to work fine for months until I decided to test against OctoPrint 1.3.9 in my dev environment using existing installation. I checked out the corresponding tag, deleted venv folder and followed setup steps. Things worked fine and I was able to run my tests.

I then wanted to go back to latest and PyCharm came with a vengeance. I checked out maintenance again, deleted venv folder and followed normal setup steps. I can run OctoPrint from command line, I can run it from PyCharm (pressing green play icon) but I cannot debug it. I deleted the entire OctoPrint folder and did new clone steps, followed setup and nada.

It goes as far as:

2019-08-15 20:41:01,597 - octoprint.plugin.core - DEBUG - Initialized plugin mixin implementation for plugin forcelogin

and then it exits with Process finished with exit code 1.

It seems like when it executes sarge.run(command + ["--version"], stdout=sarge.Capture(), stderr=sarge.Capture()) trying to find which pip is installed and which version that for some reason it exists. I tried debugging raised exceptions but couldn't figure out which one of the many raised is the one that matters (if any). I surrounded the #run() call with a try/except and I see that it prints an error like NoneType object is not callable.

I can go to the terminal in PyCharm and start up OctoPrint just fine. Running which pip returns:

/Users/gaston/repo/OctoPrint/venv/bin/pip

which I think is ok. Running out of ideas how to be able to debug OctoPrint again. Of course I tried turning it off and on ... again and still nada. :wink:

Any suggestion or idea how to get this back running will be much appreciated.
Thanks,
Gaston

There's probably a way of adding the no-cache-dir directive with pip for installing something. The documentation mentions that on UNIX the location is something like ~/.cache/pip for these earlier-created sessions (wheels perhaps). If that folder exists you might want to see what's in it.

Thanks OutsourcedGuru for the tip. There was no ~/.cache/pip but I found ~/Library/Caches/pip. I deleted that folder, restarted PyCharm and unfortunately I got the same error when trying to debug OctoPrint. What's weird is that it works if I run it (i.e. click on the play icon instead of the bug icon) but not when I try to debug it.

Thanks,
Gaston

Maybe the folks at PyCharm know how to unravel this mystery.

Good idea. Posting in their forums as well.

Quick update. Downgraded to PyCharm 2019.1 and debugger works again. Pycharm 2019.2 exists with code 1 when sarge library runs Popen(). This issue has been reported to Pycharm devs.

popen() changed from what I understand in python 3 and the average OctoPrint install uses python 2. It's likely that they didn't test on the earlier platform sufficiently.

Interesting info. Hope that helps PyCharm devs.

Gaston

I switched from Windows to Mac and the shitty debugger won't work....I was looking for hours to find a solution.
Now I found your @gdombi post and upgraded to 2019.1.4, but without success.

BUT now I am using the newest PyCharm Version 2019.2.1 and debugger IS WORKING AGAIN!!!

Thx, for this great community!!!!!
BR
Olli

2 Likes