Slicer PyCharm configuration

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Slicer PyCharm configuration

lasso2

Hi Jc,

 

I see that you added some bin\Python\slicer\kits.py file to help loading Slicer’s Python libraries into PyCharm. Could you please describe how to use it? pyDicom and some other packages load well and it’s awesome – it would be great to have it working for ctk, slicer, mrml, etc.

 

I’ve also found that you added a SlicerPython.exe executable. I’ve tried to use this exe as “Project Interpreter” but PyCharm rejected it saying “The selected file is not a valid home for Python SDK”. I renamed the SlicerPython (*.exe/*LauncherSettings.ini) to PythonSlicer and then PyCharm accepted it (python-slicer and pythonslicer worked, too). Could we change the exe file name to SlicerPython.exe so that it can be loaded as Project Interpreter as is?

 

Andras

 


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
Reply | Threaded
Open this post in threaded view
|

Re: Slicer PyCharm configuration

Jean-Christophe Fillion-Robin
Hi Andras,

On Tue, Sep 29, 2015 at 4:41 PM, Andras Lasso <[hidden email]> wrote:

I see that you added some bin\Python\slicer\kits.py file to help loading Slicer’s Python libraries into PyCharm. Could you please describe how to use it? pyDicom and some other packages load well and it’s awesome – it would be great to have it working for ctk, slicer, mrml, etc.


This is a first step that (only) allow existing slicer method available in the source tree to be auto-completed. To leverage this, you basically add Slicer/Base/Python as dependent project in your PyCharm project.

Next step would be to have VTK and Slicer VTK derived classes exposed in PyCharm. For this to work, the environment would have to be set appropriately.

Ultimately, to have Slicer& CTK Qt based classes auto-complete, we would have to make sure PythonQt wrapped classes can be imported without having an explicit Q[Core]Application running (or by having on instantiated for the sake of auto-completion ...)

 

 

I’ve also found that you added a SlicerPython.exe executable. I’ve tried to use this exe as “Project Interpreter” but PyCharm rejected it saying “The selected file is not a valid home for Python SDK”. I renamed the SlicerPython (*.exe/*LauncherSettings.ini) to PythonSlicer and then PyCharm accepted it (python-slicer and pythonslicer worked, too). Could we change the exe file name to SlicerPython.exe so that it can be loaded as Project Interpreter as is?


Makes sense. Since that executable is a convenience of the build system and currently part of the Slicer internals, I don't see any issue in renaming it.

Thanks
Jc


--
+1 919 869 8849

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
Reply | Threaded
Open this post in threaded view
|

Re: Slicer PyCharm configuration

lasso2
In reply to this post by lasso2

Thank you Jc, I’m looking forward to the ability to load more libraries into the IDE.

 

In the meantime, I’ve added PyCharm support to the Python debugger module in Slicer (in Debugging tools extension). It requires Professional edition but the price is reasonable and I’ve found it easier to set up and use. See details here:

http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/DebuggingTools

 

The Python debugger module allows full auto-completion in the debug console, stopping at breakpoints, running the script line-by-line, getting/setting variables, running commands in the console, switching between stack frames, etc. while when execution is paused anywhere in your script. The only thing still missing is auto-complete in the editor (hopefully that’ll be soon addressed by Jc).

 

Andras

 

From: Jean-Christophe Fillion-Robin [mailto:[hidden email]]
Sent: September 29, 2015 5:19 PM
To: Andras Lasso <[hidden email]>
Cc: Slicer Developers Mailing List ([hidden email]) <[hidden email]>
Subject: Re: Slicer PyCharm configuration

 

Hi Andras,

On Tue, Sep 29, 2015 at 4:41 PM, Andras Lasso <[hidden email]> wrote:

I see that you added some bin\Python\slicer\kits.py file to help loading Slicer’s Python libraries into PyCharm. Could you please describe how to use it? pyDicom and some other packages load well and it’s awesome – it would be great to have it working for ctk, slicer, mrml, etc.

 

This is a first step that (only) allow existing slicer method available in the source tree to be auto-completed. To leverage this, you basically add Slicer/Base/Python as dependent project in your PyCharm project.

Next step would be to have VTK and Slicer VTK derived classes exposed in PyCharm. For this to work, the environment would have to be set appropriately.

Ultimately, to have Slicer& CTK Qt based classes auto-complete, we would have to make sure PythonQt wrapped classes can be imported without having an explicit Q[Core]Application running (or by having on instantiated for the sake of auto-completion ...)


 

 

I’ve also found that you added a SlicerPython.exe executable. I’ve tried to use this exe as “Project Interpreter” but PyCharm rejected it saying “The selected file is not a valid home for Python SDK”. I renamed the SlicerPython (*.exe/*LauncherSettings.ini) to PythonSlicer and then PyCharm accepted it (python-slicer and pythonslicer worked, too). Could we change the exe file name to SlicerPython.exe so that it can be loaded as Project Interpreter as is?

 

Makes sense. Since that executable is a convenience of the build system and currently part of the Slicer internals, I don't see any issue in renaming it.

 

Thanks

Jc



--

+1 919 869 8849


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
Reply | Threaded
Open this post in threaded view
|

Re: Slicer PyCharm configuration

Adam Rankin-2

Would you recommend PyCharm over LiClipse?

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Andras Lasso
Sent: Sunday, October 04, 2015 12:10 PM
To: Jean-Christophe Fillion-Robin <[hidden email]>
Cc: SPL Slicer Devel <[hidden email]>
Subject: Re: [slicer-devel] Slicer PyCharm configuration

 

Thank you Jc, I’m looking forward to the ability to load more libraries into the IDE.

 

In the meantime, I’ve added PyCharm support to the Python debugger module in Slicer (in Debugging tools extension). It requires Professional edition but the price is reasonable and I’ve found it easier to set up and use. See details here:

http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/DebuggingTools

 

The Python debugger module allows full auto-completion in the debug console, stopping at breakpoints, running the script line-by-line, getting/setting variables, running commands in the console, switching between stack frames, etc. while when execution is paused anywhere in your script. The only thing still missing is auto-complete in the editor (hopefully that’ll be soon addressed by Jc).

 

Andras

 

From: Jean-Christophe Fillion-Robin [[hidden email]]
Sent: September 29, 2015 5:19 PM
To: Andras Lasso <[hidden email]>
Cc: Slicer Developers Mailing List ([hidden email]) <[hidden email]>
Subject: Re: Slicer PyCharm configuration

 

Hi Andras,

On Tue, Sep 29, 2015 at 4:41 PM, Andras Lasso <[hidden email]> wrote:

I see that you added some bin\Python\slicer\kits.py file to help loading Slicer’s Python libraries into PyCharm. Could you please describe how to use it? pyDicom and some other packages load well and it’s awesome – it would be great to have it working for ctk, slicer, mrml, etc.

 

This is a first step that (only) allow existing slicer method available in the source tree to be auto-completed. To leverage this, you basically add Slicer/Base/Python as dependent project in your PyCharm project.

Next step would be to have VTK and Slicer VTK derived classes exposed in PyCharm. For this to work, the environment would have to be set appropriately.

Ultimately, to have Slicer& CTK Qt based classes auto-complete, we would have to make sure PythonQt wrapped classes can be imported without having an explicit Q[Core]Application running (or by having on instantiated for the sake of auto-completion ...)


 

 

I’ve also found that you added a SlicerPython.exe executable. I’ve tried to use this exe as “Project Interpreter” but PyCharm rejected it saying “The selected file is not a valid home for Python SDK”. I renamed the SlicerPython (*.exe/*LauncherSettings.ini) to PythonSlicer and then PyCharm accepted it (python-slicer and pythonslicer worked, too). Could we change the exe file name to SlicerPython.exe so that it can be loaded as Project Interpreter as is?

 

Makes sense. Since that executable is a convenience of the build system and currently part of the Slicer internals, I don't see any issue in renaming it.

 

Thanks

Jc



--

+1 919 869 8849


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
Reply | Threaded
Open this post in threaded view
|

Re: Slicer PyCharm configuration

lasso2
In reply to this post by lasso2

I’ve found PyCharm to easier to set up and use than Eclipse/LiClipse. PyCharm also has much more very useful Python-specific features.

 

The only limitation of PyCharm is that it requires the professional edition for remote debugging, which is not free for all. The professional edition is free for student, staff, and open-source developers, so most people should be eligible. For commercial purposes you need to buy a license, but it is not expensive: $199 for all developers in an entire company; $99 for an individual developer.

 

Andras

 

 

From: Adam Rankin [mailto:[hidden email]]
Sent: October 5, 2015 10:45 AM
To: Andras Lasso <[hidden email]>; Jean-Christophe Fillion-Robin <[hidden email]>
Cc: SPL Slicer Devel <[hidden email]>
Subject: RE: Slicer PyCharm configuration

 

Would you recommend PyCharm over LiClipse?

 

From: [hidden email] [[hidden email]] On Behalf Of Andras Lasso
Sent: Sunday, October 04, 2015 12:10 PM
To: Jean-Christophe Fillion-Robin <[hidden email]>
Cc: SPL Slicer Devel <[hidden email]>
Subject: Re: [slicer-devel] Slicer PyCharm configuration

 

Thank you Jc, I’m looking forward to the ability to load more libraries into the IDE.

 

In the meantime, I’ve added PyCharm support to the Python debugger module in Slicer (in Debugging tools extension). It requires Professional edition but the price is reasonable and I’ve found it easier to set up and use. See details here:

http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Extensions/DebuggingTools

 

The Python debugger module allows full auto-completion in the debug console, stopping at breakpoints, running the script line-by-line, getting/setting variables, running commands in the console, switching between stack frames, etc. while when execution is paused anywhere in your script. The only thing still missing is auto-complete in the editor (hopefully that’ll be soon addressed by Jc).

 

Andras

 

From: Jean-Christophe Fillion-Robin [[hidden email]]
Sent: September 29, 2015 5:19 PM
To: Andras Lasso <[hidden email]>
Cc: Slicer Developers Mailing List ([hidden email]) <[hidden email]>
Subject: Re: Slicer PyCharm configuration

 

Hi Andras,

On Tue, Sep 29, 2015 at 4:41 PM, Andras Lasso <[hidden email]> wrote:

I see that you added some bin\Python\slicer\kits.py file to help loading Slicer’s Python libraries into PyCharm. Could you please describe how to use it? pyDicom and some other packages load well and it’s awesome – it would be great to have it working for ctk, slicer, mrml, etc.

 

This is a first step that (only) allow existing slicer method available in the source tree to be auto-completed. To leverage this, you basically add Slicer/Base/Python as dependent project in your PyCharm project.

Next step would be to have VTK and Slicer VTK derived classes exposed in PyCharm. For this to work, the environment would have to be set appropriately.

Ultimately, to have Slicer& CTK Qt based classes auto-complete, we would have to make sure PythonQt wrapped classes can be imported without having an explicit Q[Core]Application running (or by having on instantiated for the sake of auto-completion ...)


 

 

I’ve also found that you added a SlicerPython.exe executable. I’ve tried to use this exe as “Project Interpreter” but PyCharm rejected it saying “The selected file is not a valid home for Python SDK”. I renamed the SlicerPython (*.exe/*LauncherSettings.ini) to PythonSlicer and then PyCharm accepted it (python-slicer and pythonslicer worked, too). Could we change the exe file name to SlicerPython.exe so that it can be loaded as Project Interpreter as is?

 

Makes sense. Since that executable is a convenience of the build system and currently part of the Slicer internals, I don't see any issue in renaming it.

 

Thanks

Jc



--

+1 919 869 8849


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
Reply | Threaded
Open this post in threaded view
|

Re: Slicer PyCharm configuration

mosx
This post has NOT been accepted by the mailing list yet.
In reply to this post by Jean-Christophe Fillion-Robin
Hi I'm sorry for sending to you a private mail.
I want to setting up my PyCharm environment for Slicer VTK recognition. Can you help me please?