RhinoCompute PythonEvaluate simple script not working

Hello,

I am trying to use RhinoCompute’s PythonEvaluate() to execute a python file. I am getting the error: “An error occurred: Expecting value: line 1 column 1 (char 0)”.

I tried to use a much simpler python script to evaluate but the error persists. Is there something I amp missing? I have Rhino 8 installed on my machine, Rhino Compute up and running after following the tutorial on the Developer Guides.

Could someone please help me out?

Thank you very much in advance for your time and attention :slightly_smiling_face:

Here is my code:

import compute_rhino3d.Util
import compute_rhino3d.Grasshopper
import requests


compute_rhino3d.Util.url = "http://localhost:6500/"
compute_rhino3d.Util.apiKey = ""

parameters = {"a": 7, "b": 3}
output_names = ["c"]
script="""c=a+b"""

try:
    print("Testing server connectivity...")
    test_response = requests.get(compute_rhino3d.Util.url)
    print("Server Response:", test_response.status_code, test_response.text)

    print("Executing PythonEvaluate...")

    result = compute_rhino3d.Util.PythonEvaluate(script, parameters, output_names)
    print("Execution Result:", result)
except Exception as e:
    print("An error occurred:", e)

The printed statement looks like this:

Testing server connectivity…

Server Response: 200 compute.rhino3d
Executing PythonEvaluate...
An error occurred: Expecting value: line 1 column 1 (char 0)

Here is the python file I am executing:
help.py (665 Bytes)

Seems like the /rhino/python/evaluate is not wired up in compute. I have made a YT and will take a look at this

COMPUTE-311 Rhino/python/evaluate is not wired up

1 Like