nautechsystems / nautilus_trader

A high-performance algorithmic trading platform and event-driven backtester
https://nautilustrader.io
GNU Lesser General Public License v3.0
1.7k stars 398 forks source link

Rust Error while installing via pip #1720

Closed FuBuman closed 1 week ago

FuBuman commented 1 week ago

Bug Report

`

  =====================================================================
  Nautilus Builder 1.195.0
  =====================================================================
  System: Linux aarch64
  Clang:  Debian clang version 14.0.6
  Traceback (most recent call last):
    File "/tmp/pip-install-xoiygctx/nautilus-trader_e8a8d56b3d454662b6c08db7d4471e1d/build.py", line 276, in _get_rustc_version
      result = subprocess.run(
               ^^^^^^^^^^^^^^^
    File "/usr/lib/python3.11/subprocess.py", line 548, in run
      with Popen(*popenargs, **kwargs) as process:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
      raise child_exception_type(errno_num, err_msg, err_filename)
  FileNotFoundError: [Errno 2] No such file or directory: 'rustc'

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "/tmp/pip-install-xoiygctx/nautilus-trader_e8a8d56b3d454662b6c08db7d4471e1d/build.py", line 348, in <module>
      print(f"Rust:   {_get_rustc_version()}")
                       ^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-install-xoiygctx/nautilus-trader_e8a8d56b3d454662b6c08db7d4471e1d/build.py", line 285, in _get_rustc_version
      raise RuntimeError(
  RuntimeError: You are installing from source which requires the Rust compiler to be installed.
  Find more information at https://www.rust-lang.org/tools/install
  Error running rustc: [Errno 2] No such file or directory: 'rustc'
  Traceback (most recent call last):
    File "/usr/local/lib/python3.11/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/usr/local/lib/python3.11/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/local/lib/python3.11/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-__0bylwn/overlay/local/lib/python3.11/dist-packages/poetry/core/masonry/api.py", line 58, in build_wheel
      return WheelBuilder.make_in(
             ^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-__0bylwn/overlay/local/lib/python3.11/dist-packages/poetry/core/masonry/builders/wheel.py", line 88, in make_in
      wb.build(target_dir=directory)
    File "/tmp/pip-build-env-__0bylwn/overlay/local/lib/python3.11/dist-packages/poetry/core/masonry/builders/wheel.py", line 123, in build
      self._build(zip_file)
    File "/tmp/pip-build-env-__0bylwn/overlay/local/lib/python3.11/dist-packages/poetry/core/masonry/builders/wheel.py", line 172, in _build
      self._run_build_script(self._package.build_script)
    File "/tmp/pip-build-env-__0bylwn/overlay/local/lib/python3.11/dist-packages/poetry/core/masonry/builders/wheel.py", line 262, in _run_build_script
      subprocess.check_call([self.executable.as_posix(), build_script])
    File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/usr/bin/python3', 'build.py']' returned non-zero exit status 1.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for nautilus_trader Failed to build nautilus_trader ERROR: Could not build wheels for nautilus_trader, which is required to install pyproject.toml-based projects `

Specifications

Dear Team, any suggestions?

cjdsellers commented 1 week ago

Hi @FuBuman

It looks like the Rust compiler isn't available to install from source.

There's some instructions in the README for installing Rust.

Hope that helps!