alphaville / optimization-engine

Nonconvex embedded optimization: code generation for fast real-time optimization + ROS support
https://alphaville.github.io/optimization-engine/
Other
512 stars 53 forks source link

No such file or directory: 'cargo': 'cargo' #203

Closed AndThem closed 4 years ago

AndThem commented 4 years ago

Describe the bug

I tried to run the example from the doc page in a virtual environment after a fresh install but got this FileNotFound error. However cargo has been properly install and its directory added to $PATH

Traceback (most recent call last):
  File "/home/andthem/PycharmProjects/pythonProject/main.py", line 28, in <module>
    builder.build()
  File "/home/andthem/PycharmProjects/pythonProject/venv/lib/python3.6/site-packages/opengen/builder/optimizer_builder.py", line 576, in build
    self.__build_optimizer()             # build overall project
  File "/home/andthem/PycharmProjects/pythonProject/venv/lib/python3.6/site-packages/opengen/builder/optimizer_builder.py", line 419, in __build_optimizer
    p = subprocess.Popen(command, cwd=target_dir)
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cargo': 'cargo'

Process finished with exit code 1

System information:

:warning: Please, provide the following information:

Default host: x86_64-unknown-linux-gnu
rustup home:  /home/andthem/.rustup

stable-x86_64-unknown-linux-gnu (default)
rustc 1.46.0 (04488afe3 2020-08-24)
rustc 1.46.0 (04488afe3 2020-08-24)
Python 3.6.9 (default, Jul 17 2020, 12:50:27) 
[GCC 8.4.0] on linux
alphaville commented 4 years ago

Hi Andreas - thanks a lot for reporting this. The solution is to add the following line to your ~/.profile file:

export PATH="$HOME/.cargo/bin:$PATH"

See #204 - the website will be updated with more detailed instruction soon.