Python3 OSX Question

When installing ladybug tools 1.1.0 I noticed that a python3 executable is installed. Would this mean that one could write a script in GH that would be run by the ladybug python3 executable? Possibly with grasshopper inputs/outputs? Is there a way to connect to this executable in a similar way to ghpythonremote?

1 Like

Rhino uses the .Net implementation of python which is ironPython. This is still at version 2.7
Others have tried using Python 3 in grasshopper. Please look for the same on McNeel forum.

As @devang says, native GHPython will be unable to read most Python 3 libraries given that it uses Python 2.7 and the only reason why many of our ladybug tools core libraries can be loaded by GHPYthon from that folder is that we have written many of the LBT core libraries specially to work in both Python 2 and Python 3.

To more specifically answer your question about whether you could connect ghpythonremote to the Python 3 that installs with Ladybug Tools, I haven’t tested it but I see no reason why you couldn’t.

If I were to make a recommendation about what I think it the “best” way (or at least the most reusable way) to give access to Python 3 functionality in Grasshopper right now, it would be through a command line interface for the Python package that you call with subprocess in a native GH Python component. You can see that we actually do a version of this on Mac right now to get around the fact that the IronPython sqlite3 module on Mac is broken. We just make a call to the honeybee-energy CLI:

And here’s the command that is being called:

Thanks, this was exactly what I needed and I now have my project working.