PyCharm Problem?

Posted on
Sat May 04, 2019 11:39 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

PyCharm Problem?

Just tried to run a debug on my plugin (which I have done previously but not in recent days) and am getting the error messages:
PyCharm Debugging Error Unable to load PyCharm debugg .egg: /Applications/PyCharm.app/Contents/debug-eggs/pycharm-debug.egg
PyCharm Debugging Error Make sure you have the most recent version of PyCharm installed and in your /Applications/ folder
Pycharm is installed in the Applications Folder and is version PyCharm 2019.1.1 (Professional Edition) - Build #PY-191.6605.12, built on April 3, 2019.

I have looked for the file referenced and it isn't there. There is a file called: pydevd-pycharm.egg

Maybe something I have done but any pointers would be helpful. :)

Posted on
Sat May 04, 2019 6:30 pm
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: PyCharm Problem?

Hey Jon - Same problem here. I had to do two things to bring it back up:

- I had to update the plugin debug configuration in Pycharm to point to Indigo 7.3
- I had to update .bash_profile to point to the new egg filename

Then the plugin debugger would connect.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun May 05, 2019 5:51 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: PyCharm Problem?

Hi Dave,
Thanks for the help. :)

Seems like something has changed then.

The Indigo instructions for setting up Pycharm don't agree with the latest PyCharm dialogue AFAICS - not much in it but it is different.

I had fixed the 7.3 issue - I wonder whether there is a way to always pick-up the current /latest Indigo version?

I haven't got a .bash_profile on my system. :?

PyCharm does give an alternative of doing a pip install of the PyCharm egg.

Posted on
Sun May 05, 2019 5:56 am
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: PyCharm Problem?

Yep, I tried running the pip install, but that kept failing due to a permissions issue. When I realized that I could get it to work by updating the PYTHONPATH, that seemed like the easiest approach.

The easiest approach is my default; I'm inherently lazy. :D

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun May 05, 2019 6:09 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: PyCharm Problem?

So, excuse my ignorance, how do I set the PYTHONPATH?

I assume at some point that Matt/Jay will sort this issue out or inform us of the best way to set it up?

Posted on
Sun May 05, 2019 7:23 am
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: PyCharm Problem?

In Finder, select Go --> Go To Folder and then enter ~/ to get to the root user directory. In that folder, look to see if there is a file called '.bash_profile'. It may be hidden depending on your Finder settings, so you can also use Terminal (Terminal will likely open at the root user directory.) Within Terminal, type 'ls -la' to get a list of files and folders. I would recommend creating a backup of the current .bash_profile file if it exists, in case something goes sideways. If the file doesn't exist, you'll need to create one.

I prefer to use Terminal and the nano editor ['sudo nano .bash_profile']. Add the following line to the file (mine is at the top):
Code: Select all
export PYTHONPATH=$PYTHONPATH:/Applications/PyCharm.app/Contents/debug-eggs/pydevd-pycharm.egg

In nano, hit CTRL-O to write out and then CTRL-X to exit. You'll likely have to sign out/in for the active user to make the change effective.

[p.s., I've been a little overly descriptive here for anyone else that might happen across the thread.]

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun May 05, 2019 10:11 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: PyCharm Problem?

Thanks for the detailed guide. :)

Unfortunately, it still isn't working for me.

The profile is setup OK and when I start Python in a terminal, import sys and then do a sys.path, the PyCharm debug-eggs is listed. I have even copied the folder ref out of the sys.path output and pasted it into a Finder Go To folder dialogue and it takes me to the correct PyCharm folder.

I went the full-hog and rebooted my system after having setup the profile file. :?

Not sure where to go next. Fortunately, the immediate need to use the debugger has gone as I have resolved the issue I was going to use it for . :)

Posted on
Sun May 05, 2019 11:43 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: PyCharm Problem?

Good news - it now works. :D

Not sure why it didn't when I first tried it? :?

I went out for a half-hour walk with my better half and then when we got back I had another go at sorting this.

I fired up a terminal session, started python and then just did an import pydevd and it worked!

So I relaunched PyCharm and went into debugging mode, then in Indigo I reloaded the plugin in the debugger and it worked this time.

So I am happy and confused at the same time.

Anyway, Dave, thanks again for the detailed explanation on how to get this working. :)

Posted on
Sun May 05, 2019 1:57 pm
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: PyCharm Problem?

Glad to hear that you got it working. They (jetBrains) definitely changed the name of the file.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon May 06, 2019 2:02 pm
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: PyCharm Problem?

Yes, JetBrains apparently forked pydevd and are now distributing their own forked copy (pydevd_pycharm). We're importing pydevd from the PyCharm installation, which doesn't exist. We will get this fixed in 7.3.1. I hadn't run across it because I haven't tried debugging plugins since 2019.1 came out.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu May 09, 2019 2:06 pm
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: PyCharm Problem?

Update: I believe we've got it fixed in 7.3.1, which we hope to get out in the next week or so.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Nov 10, 2019 10:18 am
dclonts online
Posts: 49
Joined: Nov 05, 2006

Re: PyCharm Problem?

So help! I've go PyCharm Professional, set up the remote debug, run the plugin in the remote debug config, but doesn't seem to be working. Breakpoints never hit.

Here is the PyCharm Console after the start:

Starting debug server at port 5678
Use the following code to connect to the debugger:
import pydevd_pycharm
pydevd_pycharm.settrace('localhost', port=5678, stdoutToServer=True, stderrToServer=True, suspend=False)
Waiting for process connection...

Help! trying to get this working to debug a Hayward pool plugin I'm developing.

David Clonts

Posted on
Sun Nov 10, 2019 4:59 pm
jay (support) offline
Site Admin
User avatar
Posts: 18212
Joined: Mar 19, 2008
Location: Austin, Texas

Re: PyCharm Problem?

And you have the debugging enabled and set to PyCharm in Indigo? It looks like PyCharm is just waiting for the plugin to connect to it (you have to restart the plugin in the debugger after PyCharm is waiting for it to connect).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Nov 16, 2019 11:16 am
dclonts online
Posts: 49
Joined: Nov 05, 2006

Re: PyCharm Problem?

Working now. Last question (hopefully).

So I think when I "restarted the plugin in the debugger" I'm actually just running the code in plugin.py in PyCharm--sill see "waiting for process to connection" at the bottomWhen I run it in PyCharm, fails on "import indigo".

So I don't think I'm actually running the remote debug...thoughts? Not sure I'm actually "restarting the plugin in the debugger (PyCharm I assume) correctly"

David Clonts

Posted on
Sat Nov 16, 2019 11:24 am
dclonts online
Posts: 49
Joined: Nov 05, 2006

Re: PyCharm Problem?

...one more data point. I've checked "enabled debug menus", but no dropdown shows up for "reload in debugger" for the plugins...

David Clonts

Who is online

Users browsing this forum: No registered users and 0 guests