# Using PyCharm for channel development?

**URL:** <https://forums.plex.tv/t/using-pycharm-for-channel-development/43663>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [September 29, 2013, 3:43pm UTC](https://forums.plex.tv/t/using-pycharm-for-channel-development/43663 "2013-09-29T15:43:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jourh](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@jourh](https://forums.plex.tv/u/jourh)\
**Post date:** [September 29, 2013, 3:43pm UTC](https://forums.plex.tv/t/using-pycharm-for-channel-development/43663/1 "2013-09-29T15:43:45Z")

</div>

I've been noodling around with Channel development a bit, and I'm trying to figure out if there's a way to meaningfully use an IDE like PyCharm. Being new to Python and the PMS API, having code completion, etc would be very helpful.

&nbsp;

I don't have any expectation that I'll be able to run/debug the channel code in PyCharm (would be nice if there were some way to attach a debugger, but I digress), but it would be nice if I could at least set the IDE up such that it sees the things that the channel code will see in its environment/sandbox. For instance, when executing in the sandbox/environment that PMS sets up for the plug in, you can refer to ObjectContainer without qualification; there is seemingly an implicit "from Framework.api.objectkit import \*" happening before the channel code is run. My near-term goal is to make it so that PyCharm can see all the modules that would be implicitly imported for the channel's sandbox, primarily so things like code-completion will work right.

&nbsp;

So far, I've created a virtual environment in PyCharm, and added all three versions of the Framework.bundle's python modules to that virtual environment. Once that was set up, I was able to (explicitly) add imports to my code like "from Framework.api.objectkit import \*" and that would allow PyCharm to see the definition of ObjectContainer. Unfortunately, having that import in the code breaks the \*actual\* execution of the channel.

&nbsp;

I've looked a little bit into the sandboxing code and I see that there's this publish\_api method which appears to be responsible for making all the various framework classes available in the actual execution sandbox, but the setup of the environment/sandbox looks non-trivial, and without being able to step through it in a debugger, I'm having a hard time developing a full understanding of it.

&nbsp;

Is anyone else out there managing to do Plex Channel plug-in development in an IDE with code completion? How are they going about it? While I'm here, I guess I might as well ask: does anyone know if it's possible to somehow attach a debugger to a plugin's host process?&nbsp;

&nbsp;

Thanks!

---

<div class="post-metadata">

**Author:** ![zwalex](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/zwalex/32/626_2.png) [@zwalex](https://forums.plex.tv/u/zwalex)\
**Post date:** [October 8, 2013, 10:41pm UTC](https://forums.plex.tv/t/using-pycharm-for-channel-development/43663/2 "2013-10-08T22:41:21Z")

</div>

@jourh: I am interested in exactly the same thing. I did some Plug-in development with the V1 API and am now trying to get into the new V2.x syntax and as you said - code completion and object introspection of the Plex framework would be great.

Where did you find the "Framework.bundle's python modules" and how did you add/defined them to your IDE.

In general I would like to solicit feedback from the pro-developers what kind IDE and other tools they use to make plug-in development easier.

Thanks and Cheers,

alex

---

<div class="post-metadata">

**Author:** ![Cigaras](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/cigaras/32/163056_2.png) [@Cigaras](https://forums.plex.tv/u/Cigaras)\
**Post date:** [October 9, 2013, 1:02pm UTC](https://forums.plex.tv/t/using-pycharm-for-channel-development/43663/3 "2013-10-09T13:02:42Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![mikedm139](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mikedm139/32/96909_2.png) [@mikedm139](https://forums.plex.tv/u/mikedm139)\
**Post date:** [October 9, 2013, 6:35pm UTC](https://forums.plex.tv/t/using-pycharm-for-channel-development/43663/4 "2013-10-09T18:35:50Z")

</div>

Unfortunately, the plugin framework doesn’t lend itself to IDE implementation. That may changed in the future but in the mean time things like code auto-completion aren’t really available. I use a free code editor called “Komodo Edit” but really anything works. Have a listen to the Plex Podcast about channels and you can hear discussions about this and other topics between Sander, Ian, and me, hosted by Tobias.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 21, 2019, 12:10am UTC](https://forums.plex.tv/t/using-pycharm-for-channel-development/43663/5 "2019-12-21T00:10:52Z")

</div>

Closed on December 21, 2019, 12:10am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
