# Channel development workflow && external libraries

**URL:** <https://forums.plex.tv/t/channel-development-workflow-external-libraries/47841>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [November 25, 2013, 2:43pm UTC](https://forums.plex.tv/t/channel-development-workflow-external-libraries/47841 "2013-11-25T14:43:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyrila](https://avatars.discourse-cdn.com/v4/letter/c/4bbf92/32.png) [@cyrila](https://forums.plex.tv/u/cyrila)\
**Post date:** [November 25, 2013, 2:43pm UTC](https://forums.plex.tv/t/channel-development-workflow-external-libraries/47841/1 "2013-11-25T14:43:13Z")

</div>

Hello,

&nbsp;

I've installed Plex on a ubuntu x64 server and it's working great. It's really amazing work you're doing.

&nbsp;

I've issues developing channel though.&nbsp;

&nbsp;

First issue concerns debugging :

Each time my plugins crash I have to reboot the server via sudo service plexmediaserver restart and wait for the plex server to restart ( 30s ~ 1min ).

If I don't do that my plugin is not shown anymore, it's really annoying and make development hard.&nbsp;

Is there a solution for this ?&nbsp;

&nbsp;

Second issue concerns syspath & SecuredPython:

I don't manage to include external libraries in my \_\_init\_\_.py

I wan't to import transmissionrpc ( no need to explain what my plugin will do .. ) but I've the error:&nbsp;importerror no module named transmissionrpc

My python modules are usually installed in&nbsp;/usr/local/lib/python2.7/dist-packages or&nbsp;/usr/local/lib/python2.7/site-package and I would want these to be accessible in my plex plugin.

I tried to add the paths to sys.path.append but it's not working.

I tried to symlink theses folders to .bundle/Content/Code/Libraries/Shared but it's neither working

Adding the /transmissionrpc folder in .bundle/Content/Code is working but I would have to import all &nbsp;dependencies an it's not clean ..

&nbsp;

Any idea how to do that ?&nbsp;

&nbsp;

Thank you for your work,

&nbsp;

&nbsp;

Regards,

&nbsp;

&nbsp;

Cyril

&nbsp;

---

<div class="post-metadata">

**Author:** ![Gerk](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gerk/32/81980_2.png) [@Gerk](https://forums.plex.tv/u/Gerk)\
**Post date:** [November 25, 2013, 9:25pm UTC](https://forums.plex.tv/t/channel-development-workflow-external-libraries/47841/2 "2013-11-25T21:25:58Z")

</div>

Hi Cyril

First, if you have to restart PMS every time your channel crashes there's something else wrong with the setup. &nbsp;Which PMS version are you running? &nbsp;I remember seeing recently that there were some problems on recent linux versions of a few PMS builds so maybe you have one of these ones installed. &nbsp;I don't know the version numbers offhand but if you tell us which version you are using it would be helpful tro track it down.

I'm not positive of this, but I \_think\_ that PMS on Linux uses a bundled python version (and not the system one). &nbsp;Using external libs can get quite interesting because of this, you will need to make sure you are using the libs for the appropriate python version (which I'm not sure of but I think it's 2.5 or 2.6).

---

<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:** [November 25, 2013, 11:13pm UTC](https://forums.plex.tv/t/channel-development-workflow-external-libraries/47841/3 "2013-11-25T23:13:34Z")

</div>

I'm pretty sure that all versions of PMS now use a bundled python v2.7. As Gerk said, using external libraries gets tricky. You pretty much need to include them in your channel bundle to be sure that they will be available and work as expected. The best place to put them is in a separate "shared libraries" folder, like so:

```
-MyPlugin.bundle/
  - Contents/
    - Code/
    - Resources/
    - Services/
    - Libraries/
      - Shared/
        - MyBundledPythonLibrary/
          - ...
```

One of the other channel developers posted some details about a development environment that he uses. I (still) haven't tested it out but, it might suit your needs. Read about it [here.](https://forums.plexapp.com/index.php/topic/64662-testing-channels-using-nose)

---

<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:31am UTC](https://forums.plex.tv/t/channel-development-workflow-external-libraries/47841/4 "2019-12-21T00:31:43Z")

</div>

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