CPython running succesfully without feedback/output

Hey people,
Hey Mahmoud_Mohamed_Ouf

Let start with a big thank to Mahmoud! :slightly_smiling_face:

I hope anyone can help with this topic…

Currently I’m in need to do some calculations trough python, with numpy and similar stuff… As I read there is no native support for the Gh-internal interpreter for numpy, so I switched over to the CPython-Plugin provided here

There the issue starts…
It looks like the component runs succesfully. At least it tells me so… But, there is neither an output within the editor, nor a an output to the canvas as shown in at the github
Further more, it takes kind of forever to do a simple thing…

I have no clue what is going on.
I tried various settings:

  • different interpreters (py2.7 / py3.7)
  • admin-run Rhino
  • Rhino 5 / 6

without any improvements…

TryCPython.gh (5.6 KB)

Any advice would be amazing


I have no clue about this issue, but maybe some workaround.
Since IronPython targets dot.net, you could use Math.Net instead of numpy. In addition to that, many grasshopper user just need numpy for functionality like matrix multiplication or a Gaussian solver. Implementing this for yourself might not be as effective as using a mature library, but it has a great learning benefit.
I for myself try to prevent using 3rd party libraries for exactly this reason.

Hi Mark,
Disclaimer - I havent tried this
If you have lots of number crunching to do and can reduce it to a relatively small number of steps in and out of Rhino then you could run Cpython externally with the subprocess module, possibly using text files or even a SQL server for data exchange…

Thanks for the advice. I have to check if this is doable in a reasonable amount of time (translate it to .net)

I followed the same path for a while. Doing and reinventing the wheel again and again is good thing for learning, for sure - but is not fitting productivity…
I passed by this point. I have done a lot of wheeles ;

Thanks for the input!
I’m going to research on this approach…

For now I have done it, with a call of System.Process.Start from a C#-Component, passing a string, and getting a string. It includes a lot of formatting and parsing before, but its a hack which isn’t the worst in the moment.

Check out the files, if u are curios…


Hi Mark,
I can’t help you with this issue, but it seems that @Mahmoud_Mohamed_Ouf has not been tagged.