Grasshopper

algorithmic modeling for Rhino

Hello,

Is there a way to use pyproj in GHPython?

Cheers,

Max

Views: 768

Replies to This Discussion

Without knowing anything regarding it, you probably would have to install it.

Once installed, see: http://www.grasshopper3d.com/forum/topics/python-component-adding-r...

GhPython also uses the locations provided by the _EditPythonScript -> Options -> Module Search Path interface.

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi Giulio, thanks for the response. The module is installed; I did this with Anaconda. I can import the library in Jupyter and find out its location:

I added this path in the Rhino Python Editor, but still I get this error:

Line 51 in the __init__ function is "from pyproj import _proj". Jupyter tells me that the path for this is the same as for pyproj.

I'm not very experienced with installing and importing new libraries, maybe I'm missing something obvious here?

Cheers,

Max

Hi Max, I wrote some tips/experiences on installing Python modules for GHPython here and here that might help (essentially = do it manually).

PyProj does not work in IronPythob. https://github.com/jswhit/pyproj/issues/52

It's not an installation issues, it's compatibility of using non-Python libraries.

That was tip/experience #2 ;)

Thanks Anders and Giulio! Are there plans to change from IronPython to something else in future? Would this be a complete rework of Rhino?

IronPython is the .NET version of Python (written in C#), which is what enables us to use RhinoCommon and the .NET framework directly. You could try out the new GH_CPython component for running native CPython (written in C) modules (such as numpy etc) that run won't under IronPython. That said, I would probably personally recommend trying to find a .NET library with the functionality you are looking for and implementing that instead (less dependencies and plumbing, can always move to C# if you want to compile to a proper plugin etc).

Very interesting! Will have to check that out...

Make sure to keep us posted if you get it running with GH_CPython. Would be interested in learning more about the potentials/problems :) 

Will do!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service