# Python Plugin Creation Issues

**URL:** <https://discourse.mcneel.com/t/python-plugin-creation-issues/92370>\
**Category:** Rhino Developer\
**Tags:** python\
**Created:** [November 19, 2019, 10:59am UTC](https://discourse.mcneel.com/t/python-plugin-creation-issues/92370 "2019-11-19T10:59:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rocarbajal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/rocarbajal/32/593952_2.png) [@rocarbajal](https://discourse.mcneel.com/u/rocarbajal)\
**Post date:** [November 19, 2019, 10:59am UTC](https://discourse.mcneel.com/t/python-plugin-creation-issues/92370/1 "2019-11-19T10:59:54Z")

</div>

Hello!

I’m trying to create a plugin but I’m running into several issues I can´t find a satisfactory answer to in the forums, I’m just gonna list them here, any help or directions on where to find explanations about these subjects is much appreciated.

I´m using Python and Rhino 6 on Windows 7 with service pack 1.

1. Compiling a Plugin including my own modules, I´ve tried both using the RhinoScriptCompiler.exe and clr.CompileModules(…) but haven’t been able to get any of them to work.

2. **\</solved by Nathan Coatney\>** Getting compiled python scripts (.rhp) to run on a toolbar button. Apparently RunPythonScript “…” wont work on a compiled script, or otherwise non .py file, that makes sense, but there must be some other way to do it in order to be able to distribute a .rhi with both a .rhp and a .rui toolbar referencing its own scripts compiled into the .rhp, right?\*  
**\</solved by Nathan Coatney\>**

3. Lastly, is there anyway to create an installer for both a regular plugin for rhino and a grasshopper assembly (.ghpy) ?

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![Dancergraham](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dancergraham/32/497397_2.png) [@Dancergraham](https://discourse.mcneel.com/u/Dancergraham)\
**Post date:** [November 19, 2019, 11:14am UTC](https://discourse.mcneel.com/t/python-plugin-creation-issues/92370/2 "2019-11-19T11:14:21Z")

</div>

Hello,

Have you tried these instructions:

> **[Creating Rhino Commands Using Python](https://developer.rhino3d.com/guides/rhinopython/creating-rhino-commands-using-python/)**
>
> This guide demonstrates how to create Rhino commands from Python scripts.

-Graham

---

<div class="post-metadata">

**Author:** ![rocarbajal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/rocarbajal/32/593952_2.png) [@rocarbajal](https://discourse.mcneel.com/u/rocarbajal)\
**Post date:** [November 19, 2019, 11:17am UTC](https://discourse.mcneel.com/t/python-plugin-creation-issues/92370/3 "2019-11-19T11:17:57Z")

</div>

Yes, this didn’t work for me, the resulting .rhi file gave me an error whereas the .rhi created using RhinoScriptCompiler didn’t. Also this solution is not compiled.

---

<div class="post-metadata">

**Author:** ![Dancergraham](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dancergraham/32/497397_2.png) [@Dancergraham](https://discourse.mcneel.com/u/Dancergraham)\
**Post date:** [November 19, 2019, 11:43am UTC](https://discourse.mcneel.com/t/python-plugin-creation-issues/92370/4 "2019-11-19T11:43:31Z")

</div>

And have you tried `RunScript` instead of `RunPythonScript` ?

---

<div class="post-metadata">

**Author:** ![rocarbajal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/rocarbajal/32/593952_2.png) [@rocarbajal](https://discourse.mcneel.com/u/rocarbajal)\
**Post date:** [November 19, 2019, 5:05pm UTC](https://discourse.mcneel.com/t/python-plugin-creation-issues/92370/5 "2019-11-19T17:05:48Z")

</div>

Yes, I get type errors, or an “instruction was expected” error. I don’t really know how to go about trying it that way because I haven’t been able to find any guide, tutorial or example on RunScript for a compiled python file.

---

<div class="post-metadata">

**Author:** ![nathancoatney](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/nathancoatney/32/767339_2.png) [@nathancoatney](https://discourse.mcneel.com/u/nathancoatney)\
**Post date:** [November 19, 2019, 5:11pm UTC](https://discourse.mcneel.com/t/python-plugin-creation-issues/92370/6 "2019-11-19T17:11:44Z")

</div>

If you have commands associated with the plugin, then maybe the buttons need to run the commands, rather than the script?

---

<div class="post-metadata">

**Author:** ![rocarbajal](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/rocarbajal/32/593952_2.png) [@rocarbajal](https://discourse.mcneel.com/u/rocarbajal)\
**Post date:** [November 19, 2019, 5:22pm UTC](https://discourse.mcneel.com/t/python-plugin-creation-issues/92370/7 "2019-11-19T17:22:15Z")

</div>

Thanks mate! That really was an obvious idea I hadn`t thought about. this works for me, I don´t mind all my toolbar buttons being associated to a written command. Thank you so much!
