Solve the error that GH pythonremote don't work in Mac

Yesterday i tried install GH pythonremote in GH for Mac, It couldn’t work at first.

The error was “Location format for /Users/xxx/anaconda3/envs/xxxx/bin/”
did not match expected format: “method://env_name”(need more than 1 values to unpack).Falling back to getting python path from MacOS $PATH."
or “Runtime error (RuntimeException): Remote python /Users/xxx/anaconda3/envs/xxxx/bin/python failed on launch. Does the remote python have rpyc installed?”
or"no mudule named xxx"

These error further solved by modifying the in (/Users/username/Library/Application Support/McNeel/Rhinoceros/7.0/scripts/ghpythonremote/ ,
changing the join str ‘python’ to ‘python2.7’ like the pic showing below:

I guess this error is raised by wrong path, when you run :conda create -n rhinoremote python=2.7, you create a new environment with specific python version , but in Mac, there will be several version of python.

when you activate the env and install numpy , it will be download inside python2.7 ,not python,So you should make sure your path is directing to python2.7 not python.

1 Like

Good job zoey!

It help me a lot :slight_smile:

These days it’s probably preferable to use Hops instead!

Thx i am a newbie in GH,i will try Hops later :+1:

Thank you for reporting and debugging this, @zoeyxu59. I’ve made a note of it on github and will fix it in the next version.

I believe you should be able to workaround this bug by giving the full path, including python2.7 to GH Python Remote, but haven’t tested it. In your case it would be /Users/zoeyxu/anaconda3/envs/rhinoremote/bin/python2.7

Sound advice indeed, Hops is a great piece of remote computing integration in Grasshopper, and it’s able to do much more than run CPython! One difference is that with Hops, you will need to design your scripts such that any object crossing the boundary between IronPython and CPython needs to be serializable by rhino3dm or json. That is usually a low bar to clear.

Thank you for your advice.
Hops is amazing , I am trying to make it work in Mac .
I’ll post feedback later,Nice work!