T_renderer issue while using python interface

Hello all, :wave:

I am trying to use acados with the Python interface and the t_renderer file is not being detected for some reason.

There was another thread that suggested building the binaries natively, which I tried but was still unable to rectify the problem.

This is the error message that shows up when I try running the example : ‘minimal_example_ocp.py’

Do you wish to set up Tera renderer automatically?
y/N? (press y to download tera or any key for manual installation)
Dowloading https://github.com/acados/tera_renderer/releases/download/v0.0.34/t_renderer-v0.0.34-linux
Traceback (most recent call last):
  File "~/acados/examples/acados_python/getting_started/minimal_example_ocp.py", line 104, in <module>
  File "~/acados/examples/acados_python/getting_started/minimal_example_ocp.py", line 83, in main
    ocp_solver = AcadosOcpSolver(ocp, json_file = 'acados_ocp.json')
  File "~/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py", line 384, in __init__
    self.generate(acados_ocp, json_file=json_file, simulink_opts=simulink_opts, cmake_builder=cmake_builder)
  File "~/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py", line 313, in generate
    ocp_render_templates(acados_ocp, json_file, cmake_builder=cmake_builder, simulink_opts=simulink_opts)
  File "~/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py", line 195, in ocp_render_templates
    render_template(tup[0], tup[1], output_dir, json_path)
  File "~/acados/interfaces/acados_template/acados_template/utils.py", line 221, in render_template
    tera_path = get_tera()
  File "~/acados/interfaces/acados_template/acados_template/utils.py", line 195, in get_tera
    with urllib.request.urlopen(url) as response, open(tera_path, 'wb') as out_file:
FileNotFoundError: [Errno 2] No such file or directory: '~/acados/bin/t_renderer'

I also noticed that even though the download of the t_renderer file is initiated there is not confirmation message of it’s completion.
As you can see the error message reads No such file or directory: ‘~/acados/bin/t_renderer’ which is not true as that is where I copied the t_renderer from the built git repo to.
Any help would be appreciated. :smiley:

For anyone who is running into the same issue, I managed to solve it. It was primarily the environment variable not being assigned correctly. But the automatic download of the t_renderer executable is still an issue, so I would suggest building it natively.

Unfortunately, I cannot reproduce the problem that the download doesnt work. I wonder if there is something special about your setup.

I met the same question, I wonder if you have solution now

I don’t think my setup was any different from what I had done previously. But it is possible that the network I was on might have changed it’s permissions, but I’m not completely sure

You can just build the t_renderer executable natively by cloning the git repo and following the instructions. Or you can just download the latest release, I think that is also available

I tried to make the download more careful, but don’t know if it changes anything for you