Set up IDE for autocomplete

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

Set up IDE for autocomplete

barrett.anderies@asu.edu
Hello all,

I am trying to learn how to write scripted extensions for Slicer, but am having trouble wrapping my head around all of the different functions and objects. I usually learn how to use new objects by using autocomplete to browse through all of the object's functions. However, since my IDE can't import the libraries available for the extensions, I can't do this (i.e. my IDE can't resolve "import slicer"). Also my IDE (PyCharm) is highlighting all of the stuff it can't resolve, which is annoying. Is there a way to setup my IDE so that it can access the libraries? I apologize if this is answered somewhere in the documentation, but I haven't seen it.

Thanks!

Barrett




_______________________________________________
slicer-users mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/4.3/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Set up IDE for autocomplete

inorton
See discussion in [1], PyCharm may not be as used as hoped due to most of Slicer Python classes actually being wrapped C++.

That said, the place to start is running `/path/to/Slicer --launcher-show-set-environment-commands` which will show the environment variables required. You will need to configure a new local interpreter in PyCharm with at least the variables PYTHONHOME and PYTHONPATH, as well as LD_LIBRARY_PATH (linux) or DYLD_LIBRARY_PATH (mac). On Windows the items in PATH should probably be placed before any existing system PATH settings.


On Mon, Mar 13, 2017 at 12:43 AM, [hidden email] <[hidden email]> wrote:
Hello all,

I am trying to learn how to write scripted extensions for Slicer, but am having trouble wrapping my head around all of the different functions and objects. I usually learn how to use new objects by using autocomplete to browse through all of the object's functions. However, since my IDE can't import the libraries available for the extensions, I can't do this (i.e. my IDE can't resolve "import slicer"). Also my IDE (PyCharm) is highlighting all of the stuff it can't resolve, which is annoying. Is there a way to setup my IDE so that it can access the libraries? I apologize if this is answered somewhere in the documentation, but I haven't seen it.

Thanks!

Barrett




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


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