Can't run in Pycharm, but ok in VS code

Hi :wave:

interface of acados :Python
I can run the example minimal_example_ocp.py in VS code, but not in Pycharm. They both use the same Interpreter. Can anyone give me some suggestions?

error message in Pycharm:

/home/wang/anaconda3/envs/acados/bin/python /home/wang/acados/examples/acados_python/getting_started/ocp/minimal_example_ocp.py
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
Warning: Did not find environment variable ACADOS_SOURCE_DIR, guessed ACADOS_PATH to be /home/wang/acados.
Please export ACADOS_SOURCE_DIR to not avoid this warning.
rm -f libacados_ocp_solver_pendulum_ode.so
rm -f acados_solver_pendulum_ode.o
( cd pendulum_ode_model; gcc -fPIC -std=c99  -c   pendulum_ode_expl_ode_fun.c pendulum_ode_expl_vde_forw.c)
gcc -fPIC -std=c99  -c acados_solver_pendulum_ode.c -I /home/wang/acados/include/blasfeo/include/ -I /home/wang/acados/include/hpipm/include/ \
-I /home/wang/acados/include -I /home/wang/acados/include/acados/ \

gcc -fPIC -std=c99  -shared -o libacados_ocp_solver_pendulum_ode.so  acados_solver_pendulum_ode.o  pendulum_ode_model/pendulum_ode_expl_ode_fun.o pendulum_ode_model/pendulum_ode_expl_vde_forw.o \
-L -l \
-L /home/wang/acados/lib -lacados -lhpipm -lblasfeo \
-lm \

Traceback (most recent call last):
  File "/home/wang/acados/examples/acados_python/getting_started/ocp/minimal_example_ocp.py", line 102, in <module>
    ocp_solver = AcadosOcpSolver(ocp, json_file = 'acados_ocp.json')
  File "/home/wang/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py", line 753, in __init__
    self.shared_lib = CDLL(self.shared_lib_name)
  File "/home/wang/anaconda3/envs/acados/lib/python3.8/ctypes/__init__.py", line 381, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libacados.so: cannot open shared object file: No such file or directory
Exception ignored in: <function AcadosOcpSolver.__del__ at 0x7f9dc35658b0>
Traceback (most recent call last):
  File "/home/wang/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py", line 1368, in __del__
    model = self.acados_ocp.model
AttributeError: 'AcadosOcpSolver' object has no attribute 'acados_ocp'

Process finished with exit code 1

Best regards :smile:
Baosai