Troubleshooting PyCharm Debug Egg File Path Configuration in 3DSlicer

Hello Dear Developers and Users,

OS: Ubuntu 22.04.3 LTS
Slicer: 5.0.2 r30822
PyCharm: 2021.3 (Professional Edition)

First, I must mention that unfortunately, I am unable to set the PyCharm debug egg file path in the latest version of 3DSlicer, which is 5.6.2. I raised this issue in my previous report. As a result, I had to switch to 3DSlicer version 5.0.2 that have this setting.

I am following the steps mentioned on the GitHub site regarding the SlicerDebuggingTools module. As shown in the image below, I have configured the PyCharm settings.

I am following the steps mentioned on the GitHub site regarding the SlicerDebuggingTools module. As shown in the image below, I have configured the PyCharm settings.

I have also configured the settings in 3DSlicer.

As you can see, the .egg file is located at the following path on my system:
/home/sn/pycharm-2021.3/debug-eggs/pydevd-pycharm.egg

Next, I started the Debug Slicer remote debugger in PyCharm.
PyCharm screenshot:

In 3DSlicer, I clicked on “Connect to PyCharm Server.”

As you can see, I am encountering the following error:
Expected: /home/sn/pycharm-2021.3/debug-eggs/pydevd-pycharm.egg/pydevd_attach_to_process/attach_linux_amd64.so to exist.

I should mention that the compressed file pydevd-pycharm.egg located at
/home/sn/pycharm-2021.3/debug-eggs/
contains the pydevd-pycharm.egg file. To investigate this, I extracted the pydevd-pycharm.egg file.
I realized that egg packages can be installed with pip, but it still wasn’t helpful as see below:

Please guide me to solve it. I want to develop and debug my modules in PyCharm.
Best regards.
Shahrokh.

I’ve been experiencing similar issues getting my Slicer Python Debug connection to PyCharm up and running.

Windows 10 Enterprise 19045.5131
Slicer 5.6.2
PyCharm 2024.3 (Pro)

I had previously installed PyCharm 2024.2.4 and encountered the .egg issue. I also found the stackoverflow thread on extracting- but the path wath still pointed to _attach_proces… under the .egg dir. I uninstalled .2.4 and installed 2024.3.

In PyCharm I configured the remote debugger

and I successfully built the pydev-pycharm within pycharm terminal as instructed:

I also noticed in my extension wizard created test module, the vtk and slicer imports showed an error- on a whim I pip import vtk:

The import pycharm warnings went away…

I updated my .egg path in the 5.6.2 pydebug

Launch the remote debugger

Try to Connect to PyCharm debugger within Slicer… and the process just hangs…

I created incoming and outgoing port forwarding rules, and updated my pycharm interpreter to the PythonSlicer.exe in my 5.6.2 folder

I am still hanging

Just for future reference, this was due to a bug in PyCharm. Workaround is described in the extension’s documentation and users may also consider switching to Visual Studio Code.