# GH python: Error importing ghpythonlib.components

**URL:** <https://discourse.mcneel.com/t/gh-python-error-importing-ghpythonlib-components/27513>\
**Category:** Scripting\
**Created:** [December 11, 2015, 12:47pm UTC](https://discourse.mcneel.com/t/gh-python-error-importing-ghpythonlib-components/27513 "2015-12-11T12:47:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lemberski](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/lemberski/32/769420_2.png) [@lemberski](https://discourse.mcneel.com/u/lemberski)\
**Post date:** [December 11, 2015, 12:47pm UTC](https://discourse.mcneel.com/t/gh-python-error-importing-ghpythonlib-components/27513/1 "2015-12-11T12:47:03Z")

</div>

I get this error trying to run the python script from this file ([mesh edge finder.gh](http://www.grasshopper3d.com/forum/attachment/download?id=2985220%3AUploadedFile%3A1418518)) ([here the discussion](http://www.grasshopper3d.com/forum/topics/python-scripts-with-ghpython-components-slow-down-grasshopper?commentId=2985220%3AComment%3A1418517)):

Runtime error (IndexOutOfRangeException): index out of range: 0  
Traceback:  
line 117, in \_\_build\_module, "C:\Users\jimbo\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\ghpythonlib\[components.py](http://components.py)"  
line 126, in , "C:\Users\jimbo\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\ghpythonlib\[components.py](http://components.py)"  
line 1, in script

Even a script with this single line

import ghpythonlib.components as ghcomp

produces an error. Importing rhinoscriptsyntax works fine. Any hints how to solve this?

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![Victor\_Calixto](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/victor_calixto/32/52927_2.png) [@Victor\_Calixto](https://discourse.mcneel.com/u/Victor_Calixto)\
**Post date:** [January 24, 2016, 1:35am UTC](https://discourse.mcneel.com/t/gh-python-error-importing-ghpythonlib-components/27513/2 "2016-01-24T01:35:19Z")

</div>

Hey lemberski!  
I have the same problem here !

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [June 1, 2016, 2:59pm UTC](https://discourse.mcneel.com/t/gh-python-error-importing-ghpythonlib-components/27513/3 "2016-06-01T14:59:43Z")

</div>

Hi David

sorry nobody checked this thread and answered it earlier. I missed it. It seems it’s still relevant.

This seems to be a problem in the components module – and I am not an expert in that module, so I would need some help tracking it down.

Are you having access to Rhino WIP? The components module was slightly changed, and maybe it will work there. Please perform a test on Rhino WIP.

As I am not seeing the issue, I believe this has to do with a third-party add-on you have installed on your machine, but which I do not.

The only sure way to rule that out, is to move all your third-party libraries, excluding GhPython, on a memory stick, and removing the memory stick. Then, restarting Rhino & GH.

If this fixes it, then they can be added one by one, till the problematic one is found. I suppose components that do timer, looping and similar concepts might cause problems with this library, but I do not know for sure.

Please let me know how that goes.

## Giulio

Giulio Piacentino  
for Robert McNeel & Associates  
[giulio@mcneel.com](mailto:giulio@mcneel.com)

---

<div class="post-metadata">

**Author:** ![lemberski](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/lemberski/32/769420_2.png) [@lemberski](https://discourse.mcneel.com/u/lemberski)\
**Post date:** [June 2, 2016, 3:57pm UTC](https://discourse.mcneel.com/t/gh-python-error-importing-ghpythonlib-components/27513/4 "2016-06-02T15:57:32Z")

</div>

Hi Guilio,

I have the latest WIP installed (6.0.16152.9051, 05/31/2016), same problem here. With the method you described I nailed it down to one plugin which seems to cause the error: Vipers  
[http://www.food4rhino.com/project/tangchi?etx](http://www.food4rhino.com/project/tangchi?etx) (attached as zip).  
Can you repeat the error on your machine?

Cheers,  
David

[vipers\_by\_tc20160119.zip](https://discourse.mcneel.com/uploads/default/original/3X/8/7/87ecfe0fc3a28cb0ad97ad9556d2687fedb7234e.zip) (323 KB)

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [June 2, 2016, 4:41pm UTC](https://discourse.mcneel.com/t/gh-python-error-importing-ghpythonlib-components/27513/5 "2016-06-02T16:41:14Z")

</div>

I’m sorry, I do not have Viper installed.  
My suggestion would be to contact its developer for information.

Thanks

## Giulio

Giulio Piacentino  
for Robert McNeel & Associates  
[giulio@mcneel.com](mailto:giulio@mcneel.com)

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [June 17, 2016, 10:15am UTC](https://discourse.mcneel.com/t/gh-python-error-importing-ghpythonlib-components/27513/6 "2016-06-17T10:15:32Z")

</div>

I am working with the developer of Vipers to resolve this issue.  
We think we can get this to work in a next release.

## Giulio

Giulio Piacentino  
for Robert McNeel & Associates  
[giulio@mcneel.com](mailto:giulio@mcneel.com)

---

<div class="post-metadata">

**Author:** ![djordje](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/djordje/32/747634_2.png) [@djordje](https://discourse.mcneel.com/u/djordje)\
**Post date:** [August 14, 2017, 1:35pm UTC](https://discourse.mcneel.com/t/gh-python-error-importing-ghpythonlib-components/27513/7 "2017-08-14T13:35:15Z")

</div>

Hi @piac,

The fix for GHPython component being “compatible” with Vipers component has been released as a part of Rhino WIP Grasshopper?  
There was a user today [who reported this issue again](http://www.grasshopper3d.com/group/gismo/forum/topics/starting-gismo-error) with Vipers component on Rhino 5 and GHPython 0.6.0.3.

---

<div class="post-metadata">

**Author:** ![piac](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/piac/32/769366_2.png) [@piac](https://discourse.mcneel.com/u/piac)\
**Post date:** [August 15, 2017, 4:17pm UTC](https://discourse.mcneel.com/t/gh-python-error-importing-ghpythonlib-components/27513/8 "2017-08-15T16:17:30Z")

</div>

The fix is in Rhino WIP @djordje . There is no plan for an update of GhPython for v5 at the moment.

---

<div class="post-metadata">

**Author:** ![djordje](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/djordje/32/747634_2.png) [@djordje](https://discourse.mcneel.com/u/djordje)\
**Post date:** [August 15, 2017, 6:27pm UTC](https://discourse.mcneel.com/t/gh-python-error-importing-ghpythonlib-components/27513/10 "2017-08-15T18:27:27Z")

</div>

Thank you for the reply Giulio!
