Acados Python Interface Error

Hello,

I am trying to follow the instructions at https://docs.acados.org/interfaces/index.html with the python interface. However, even though the installation went successfully, I am as of yet unable to run any of the python examples.

The instructions with the python module seems to be not completely updated, for example the instructions are to install the acados_template files with pip, but the Readme file in acados/interfaces/acados_templates correctly says to install using pip3.

There is a small bug with the rel_sync_machine_example, where it does not create the folder c_generated_code by itself unlike the other two examples, but it goes away if you manually create the file.

The error that I cannot get past that happens in all examples:
acados/examples/acados_template/python/pendulum_example
acados/examples/acados_template/python/rel_sync_machine_example
acados/examples/acados_template/python/soft_constraints
is the following:

The error seems to be dlopen not being able to open the shared library libacados_solver_pendulum_ode.so. The library is already created and the gcc build process does not raise any error, but it just cannot open the library.

I am using Ubuntu 16.04.6 LTS, gcc 7.4.0 and python 3.5.

Thanks and Cheers!
Can

1 Like

Hi Can,

First of all, thanks for interest in acados :slight_smile:

That should depend on whether you are running from a virtual environment and/or on your system’s settings. The Package requires anyway that you use Python 3.5 or 3.6 at the moment. I have updated the instructions anyway in order to make this clearer (they will be uploaded in the next hours/couple of days).

I have made a PR to fix this, thanks! (it should be merged in the next hours)

Regarding this, could you send me the build error right above? It works fine on my machine.

Cheers,
Andrea

1 Like

Actually, did you add the install location to LD_LIBRARY_PATH?

Yes, the libraries were in my LD_LIBRARY_PATH and I had previously checked in my terminal if it was the problem, but the path seemed to be there.

But thanks to this tip, I have solved the problem. You see i am using pycharm and while the environment variables are correctly set in the pycharm terminal, due to me having previously tinkered with the run/build configurations of the pycharm, the LD_LIBRARY_PATH was not being adopted from the terminal, but was rather being overriden by my previous configuration.

With that fixed, I am able to run both:
acados/examples/acados_template/python/pendulum_example
acados/examples/acados_template/python/soft_constraints

however, the acados/examples/acados_template/python/rel_sync_machine_example is giving me a build error:

Thanks,
Can

Hi Can,

Glad to know that your problem is fixed :slight_smile: The bug you see now should have been fixed a couple of days ago (https://github.com/acados/acados/commit/dd4b5e0bbdfa1b50bbfd84576e435ac1c6f469e6).

Cheers,
Andrea

1 Like