Can not Install Rust and Python Environment in Docker

375 views Asked by At

I am trying to install the package nautilus_trader (https://github.com/nautechsystems/nautilus_trader & https://docs.nautilustrader.io/getting_started/installation.html) in a docker container. However it always fails at compiling data fusion.


I am using a dev container setup in visual studio code

My dev container File:

// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
    "name": "Existing Dockerfile",
    "build": {
        // Sets the run context to one level up instead of the .devcontainer folder.
        "context": "..",
        // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
        "dockerfile": "../dockerfile"
    },
    "customizations": {
        "vscode": {
            "extensions": [
                "ms-python.python",
                "ms-toolsai.jupyter-keymap",
                "ms-toolsai.jupyter",
                "GitHub.copilot",
                "njpwerner.autodocstring",
                "ms-azuretools.vscode-docker"
            ]
        }
    }

    // Features to add to the dev container. More info: https://containers.dev/features.
    // "features": {},

    // Use 'forwardPorts' to make a list of ports inside the container available locally.
    // "forwardPorts": [],

    // Uncomment the next line to run commands after the container is created.
    // "postCreateCommand": "cat /etc/os-release",

    // Configure tool-specific properties.
    // "customizations": {},

    // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
    // "remoteUser": "devcontainer"
}

My docker File:

FROM python:3.11-slim as base
ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PIP_NO_CACHE_DIR=off \
    PIP_DISABLE_PIP_VERSION_CHECK=on \
    PIP_DEFAULT_TIMEOUT=100 \
    PYSETUP_PATH="/opt/pysetup" \
    BUILD_MODE="release"

ENV PATH="/root/.cargo/bin:$POETRY_HOME/bin:$PATH"
ENV PYTHON_CONFIGURE_OPTS="--enable-shared"

FROM base as builder

# Install build deps
RUN apt-get update && \
    apt-get install -y curl clang git openssh-client libssl-dev make pkg-config gcc python3-dev && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Install Rust stable 
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y

# install requirements from requirements.txt
# COPY requirements.txt requirements.txt
# RUN pip install -r requirements.txt

# set working directory
WORKDIR /workspace

It successfully creates the container.

However when running

pip install -U nautilus_trader

results in the following error:

Building wheels for collected packages: nautilus_trader, psutil
  Building wheel for nautilus_trader (pyproject.toml) ... /^error
  error: subprocess-exited-with-error
  
  × Building wheel for nautilus_trader (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [721 lines of output]
      
      =====================================================================
      Nautilus Builder 1.179.0
      =====================================================================
      System: Linux aarch64
      Clang:  Debian clang version 14.0.6
      Rust:   1.73.0 (cc66ad468 2023-10-03)
      Python: 3.11.6
      Cython: 3.0.4
      NumPy:  1.26.1
      
      BUILD_MODE=release
      BUILD_DIR=build/optimized
      PROFILE_MODE=False
      ANNOTATION_MODE=False
      PARALLEL_BUILD=True
      COPY_TO_SOURCE=True
      PYO3_ONLY=False
      
      Starting build...
      Compiling Rust libraries...
      cargo build --release --all-features
      info: syncing channel updates for 'nightly-aarch64-unknown-linux-gnu'
      info: latest update on 2023-11-02, rust version 1.75.0-nightly (75b064d26 2023-11-01)
      info: downloading component 'cargo'
      info: downloading component 'clippy'
      info: downloading component 'rust-docs'
      info: downloading component 'rust-std'
      info: downloading component 'rustc'
      info: downloading component 'rustfmt'
      info: installing component 'cargo'
      info: installing component 'clippy'
      info: installing component 'rust-docs'
      info: installing component 'rust-std'
      info: installing component 'rustc'
      info: installing component 'rustfmt'
          Updating crates.io index
          Updating git repository `https://github.com/anderslanglands/ustr`
          Updating git repository `https://github.com/snapview/tungstenite-rs`
       Downloading crates ...
         ** Download various packages **
         ** Compiling various packages **
         Compiling ppv-lite86 v0.2.17
         Compiling rand_chacha v0.3.1
         Compiling thrift v0.17.0
         Compiling object_store v0.7.1
         Compiling arrow-string v47.0.0
         Compiling brotli v3.4.0
         Compiling arrow-csv v47.0.0
         Compiling derive_builder_core v0.12.0
         Compiling arrow-json v47.0.0
         Compiling arrow-ord v47.0.0
         Compiling arrow-row v47.0.0
         Compiling arrow-arith v47.0.0
         Compiling twox-hash v1.6.3
         Compiling sqlparser_derive v0.1.1
         Compiling cpufeatures v0.2.10
         Compiling spin v0.5.2
         Compiling seq-macro v0.3.5
         Compiling untrusted v0.7.1
         Compiling sqlparser v0.38.0
         Compiling arrow v47.0.0
         Compiling derive_builder_macro v0.12.0
         Compiling tabled_derive v0.6.0
         Compiling nautilus-model v0.10.0 (/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/model)
         Compiling uuid v1.5.0
         Compiling openssl v0.10.57
         Compiling foreign-types-shared v0.1.1
         Compiling foreign-types v0.3.2
         Compiling rust_decimal_macros v1.32.0
         Compiling openssl-macros v0.1.1
         Compiling blake3 v1.5.0
         Compiling native-tls v0.2.11
         Compiling openssl-probe v0.1.5
         Compiling httparse v1.8.0
         Compiling http v0.2.9
         Compiling rmp v0.8.12
         Compiling lzma-sys v0.1.20
         Compiling bzip2-sys v0.1.11+1.0.8
         Compiling rustls v0.21.7
         Compiling constant_time_eq v0.3.0
         Compiling arrayref v0.3.7
         Compiling zstd-safe v7.0.0
         Compiling fixedbitset v0.4.2
         Compiling petgraph v0.6.4
         Compiling rmp-serde v1.1.2
         Compiling sct v0.7.0
         Compiling rustls-webpki v0.101.6
         Compiling sha2 v0.10.8
         Compiling md-5 v0.10.6
         Compiling blake2 v0.10.6
         Compiling ustr v0.10.0 (https://github.com/anderslanglands/ustr#c78ddc25)
         Compiling dashmap v5.5.3
         Compiling bytecount v0.6.4
         Compiling hex v0.4.3
         Compiling unicode-segmentation v1.10.1
         Compiling papergrid v0.9.1
         Compiling nautilus-common v0.10.0 (/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/common)
         Compiling crossbeam-utils v0.8.16
         Compiling regex-syntax v0.6.29
         Compiling try-lock v0.2.4
         Compiling regex-automata v0.1.10
         Compiling want v0.3.1
         Compiling tabled v0.12.2
         Compiling http-body v0.4.5
         Compiling derive_builder v0.12.0
         Compiling rustls-webpki v0.100.3
         Compiling sha1 v0.10.6
         Compiling rustls-pemfile v1.0.3
         Compiling socket2 v0.4.10
         Compiling httpdate v1.0.3
         Compiling thousands v0.2.0
         Compiling powerfmt v0.2.0
         Compiling evalexpr v11.1.0
         Compiling utf-8 v0.7.6
         Compiling overload v0.1.1
         Compiling tower-service v0.3.2
         Compiling data-encoding v2.4.0
         Compiling hyper v0.14.27
         Compiling nu-ansi-term v0.46.0
         Compiling deranged v0.3.9
         Compiling webpki-roots v0.23.1
         Compiling rustls-native-certs v0.6.3
         Compiling matchers v0.1.0
         Compiling tokio-rustls v0.24.1
         Compiling tokio-util v0.7.9
         Compiling tracing-log v0.1.3
         Compiling sharded-slab v0.1.7
         Compiling pyo3-asyncio-macros v0.19.0
         Compiling thread_local v1.1.7
         Compiling glob v0.3.1
         Compiling time-core v0.1.2
         Compiling compare v0.1.0
         Compiling binary-heap-plus v0.5.0
         Compiling time v0.3.30
         Compiling tracing-subscriber v0.3.17
         Compiling pyo3-asyncio v0.19.0
         Compiling crossbeam-channel v0.5.8
         Compiling nautilus-backtest v0.10.0 (/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/backtest)
         Compiling nonzero_ext v0.3.0
         Compiling tracing-appender v0.2.2
         Compiling bzip2 v0.4.4
         Compiling lz4 v1.24.0
         Compiling zstd v0.12.4
         Compiling zstd v0.13.0
         Compiling parquet v47.0.0
         Compiling xz2 v0.1.7
         Compiling async-compression v0.4.4
         Compiling datafusion-common v32.0.0
         Compiling datafusion-expr v32.0.0
         Compiling datafusion-physical-expr v32.0.0
         Compiling datafusion-execution v32.0.0
         Compiling datafusion-sql v32.0.0
         Compiling tokio-native-tls v0.3.1
         Compiling tungstenite v0.20.1 (https://github.com/snapview/tungstenite-rs#8b3ecd3c)
         Compiling hyper-tls v0.5.0
         Compiling tokio-tungstenite v0.19.0 (/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/network/tokio-tungstenite)
         Compiling datafusion-optimizer v32.0.0
         Compiling datafusion-physical-plan v32.0.0
         Compiling nautilus-network v0.10.0 (/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/network)
         Compiling datafusion v32.0.0
      error: could not compile `parquet` (lib)
      
      Caused by:
        process didn't exit successfully: `/root/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/bin/rustc --crate-name parquet --edition=2021 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parquet-47.0.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C codegen-units=1 --cfg 'feature="arrow"' --cfg 'feature="arrow-array"' --cfg 'feature="arrow-buffer"' --cfg 'feature="arrow-cast"' --cfg 'feature="arrow-data"' --cfg 'feature="arrow-ipc"' --cfg 'feature="arrow-schema"' --cfg 'feature="arrow-select"' --cfg 'feature="async"' --cfg 'feature="base64"' --cfg 'feature="brotli"' --cfg 'feature="default"' --cfg 'feature="flate2"' --cfg 'feature="futures"' --cfg 'feature="lz4"' --cfg 'feature="object_store"' --cfg 'feature="snap"' --cfg 'feature="tokio"' --cfg 'feature="zstd"' -C metadata=732a882532a44912 -C extra-filename=-732a882532a44912 --out-dir /tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps -C strip=symbols -L dependency=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps --extern ahash=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libahash-f8c7e181ec531570.rmeta --extern arrow_array=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libarrow_array-391b751877378487.rmeta --extern arrow_buffer=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libarrow_buffer-4c2dc118f28f9830.rmeta --extern arrow_cast=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libarrow_cast-e3651f97941bb398.rmeta --extern arrow_data=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libarrow_data-ffec4b4d68adfe46.rmeta --extern arrow_ipc=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libarrow_ipc-3c7cd6bfdf394632.rmeta --extern arrow_schema=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libarrow_schema-66e81e2106597b2b.rmeta --extern arrow_select=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libarrow_select-7e089b3f91c42157.rmeta --extern base64=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libbase64-2e3db9966e70dada.rmeta --extern brotli=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libbrotli-bc16e04d11798417.rmeta --extern bytes=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libbytes-cf462e343a7efd20.rmeta --extern chrono=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libchrono-e76497d77660c6fb.rmeta --extern flate2=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libflate2-ebe1a782e431604d.rmeta --extern futures=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libfutures-52698374686e6a1c.rmeta --extern hashbrown=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libhashbrown-e37b74be31fd9681.rmeta --extern lz4=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/liblz4-f8ac8e02131c2456.rmeta --extern num=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libnum-a636535aa738e27f.rmeta --extern num_bigint=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libnum_bigint-2e83c170636fea6d.rmeta --extern object_store=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libobject_store-dac970a11e38b020.rmeta --extern paste=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libpaste-2c291736c09ae1f3.so --extern seq_macro=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libseq_macro-3bf6615f31e71763.so --extern snap=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libsnap-20be7abf350a600d.rmeta --extern thrift=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libthrift-fe02920cff57b0ba.rmeta --extern tokio=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libtokio-5532a7fed261ab11.rmeta --extern twox_hash=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libtwox_hash-be7d80bbaf3358ab.rmeta --extern zstd=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libzstd-18e8d487e3626f92.rmeta --cap-lints allow '-Aclippy::drop_non_drop' -L native=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/build/lz4-sys-da126b84bb35ea50/out -L native=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/build/zstd-sys-c268c5a67360357f/out` (signal: 9, SIGKILL: kill)
      warning: build failed, waiting for other jobs to finish...
      error: could not compile `datafusion-physical-expr` (lib)
      
      Caused by:
        process didn't exit successfully: `/root/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/bin/rustc --crate-name datafusion_physical_expr --edition=2021 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/datafusion-physical-expr-32.0.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C codegen-units=1 --cfg 'feature="base64"' --cfg 'feature="blake2"' --cfg 'feature="blake3"' --cfg 'feature="crypto_expressions"' --cfg 'feature="default"' --cfg 'feature="encoding_expressions"' --cfg 'feature="hex"' --cfg 'feature="md-5"' --cfg 'feature="regex"' --cfg 'feature="regex_expressions"' --cfg 'feature="sha2"' --cfg 'feature="unicode-segmentation"' --cfg 'feature="unicode_expressions"' -C metadata=d75827de064fcc86 -C extra-filename=-d75827de064fcc86 --out-dir /tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps -C strip=symbols -L dependency=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps --extern ahash=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libahash-f8c7e181ec531570.rmeta --extern arrow=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libarrow-0e2d1cea6856de05.rmeta --extern arrow_array=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libarrow_array-391b751877378487.rmeta --extern arrow_buffer=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libarrow_buffer-4c2dc118f28f9830.rmeta --extern arrow_schema=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libarrow_schema-66e81e2106597b2b.rmeta --extern base64=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libbase64-2e3db9966e70dada.rmeta --extern blake2=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libblake2-3de0823269d97639.rmeta --extern blake3=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libblake3-66d079205f8d1ac4.rmeta --extern chrono=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libchrono-e76497d77660c6fb.rmeta --extern datafusion_common=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libdatafusion_common-9b25e7aa02b0e689.rmeta --extern datafusion_expr=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libdatafusion_expr-d40df74bb09b4495.rmeta --extern half=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libhalf-c94cfd11d1b0b977.rmeta --extern hashbrown=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libhashbrown-e37b74be31fd9681.rmeta --extern hex=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libhex-0cfcc65bfb9e14c1.rmeta --extern indexmap=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libindexmap-4ce0b8e6517f109f.rmeta --extern itertools=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libitertools-394413f0bd459b6d.rmeta --extern libc=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/liblibc-39537ece03a37e4f.rmeta --extern log=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/liblog-5d9f4f403d0578b4.rmeta --extern md5=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libmd5-5fbffd3035165d47.rmeta --extern paste=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libpaste-2c291736c09ae1f3.so --extern petgraph=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libpetgraph-6615ffef5850fa07.rmeta --extern rand=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/librand-b3c4d5d75d08e2d0.rmeta --extern regex=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libregex-de18c839e12efdeb.rmeta --extern sha2=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libsha2-a1e6fb9e92d194de.rmeta --extern unicode_segmentation=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libunicode_segmentation-65a8986ee38e3092.rmeta --extern uuid=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/deps/libuuid-66b93dc7acac5cf2.rmeta --cap-lints allow '-Aclippy::drop_non_drop' -L native=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/build/blake3-e411be9361602c0f/out -L native=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/build/lz4-sys-da126b84bb35ea50/out -L native=/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/nautilus_core/target/release/build/zstd-sys-c268c5a67360357f/out` (signal: 9, SIGKILL: kill)
      Traceback (most recent call last):
        File "/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/build.py", line 100, in _build_rust_libs
          subprocess.run(
        File "/usr/local/lib/python3.11/subprocess.py", line 571, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cargo', 'build', '--release', '--all-features']' returned non-zero exit status 101.
      
      The above exception was the direct cause of the following exception:
      
      Traceback (most recent call last):
        File "/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/build.py", line 354, in <module>
          build()
        File "/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/build.py", line 307, in build
          _build_rust_libs()
        File "/tmp/pip-install-jmgbdbj5/nautilus-trader_36ee0ae5551b47ea93ea30b413802ebe/build.py", line 106, in _build_rust_libs
          raise RuntimeError(
      RuntimeError: Error running cargo: Command '['cargo', 'build', '--release', '--all-features']' returned non-zero exit status 101.
      Traceback (most recent call last):
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.11/site-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/site-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-_6sya1uv/overlay/lib/python3.11/site-packages/poetry/core/masonry/api.py", line 58, in build_wheel
          return WheelBuilder.make_in(
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-_6sya1uv/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/wheel.py", line 88, in make_in
          wb.build(target_dir=directory)
        File "/tmp/pip-build-env-_6sya1uv/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/wheel.py", line 123, in build
          self._build(zip_file)
        File "/tmp/pip-build-env-_6sya1uv/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/wheel.py", line 172, in _build
          self._run_build_script(self._package.build_script)
        File "/tmp/pip-build-env-_6sya1uv/overlay/lib/python3.11/site-packages/poetry/core/masonry/builders/wheel.py", line 266, in _run_build_script
          subprocess.check_call([self.executable.as_posix(), build_script])
        File "/usr/local/lib/python3.11/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/usr/local/bin/python', '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
  Building wheel for psutil (pyproject.toml) ... done
  Created wheel for psutil: filename=psutil-5.9.6-cp311-abi3-linux_aarch64.whl size=285307 sha256=1001ab380522c05286bb4070128da10f19009610f9c22a4537fd93c83478149e
  Stored in directory: /tmp/pip-ephem-wheel-cache-nqhe0y4s/wheels/e7/d5/c0/20823c8375fdfa97fe0aea4f718185c7d07e9aee188577bee6
Successfully built psutil
Failed to build nautilus_trader
ERROR: Could not build wheels for nautilus_trader, which is required to install pyproject.toml-based projects

I am Using MacOS14.1 M1 chip and Docker Desktop 4.25.0

Edit: Some friends on mine can execute the commands without errors (Also Mac, but not with M1 chip - however that's why we use docker...)

Had to Edit to Logging Output for Stack overflow. Thanks for your help!

1

There are 1 answers

0
Simon Leiner On

Solved it:

Edited

FROM python:3.11-slim

to

FROM --platform=linux/amd64 python:3.11-slim

in my docker file.

Solution from: Error with pip install in Docker on Mac M1 when using Slim distribution of Python