# Error building TensorFlow in Rust

**URL:** <https://discuss.ai.google.dev/t/error-building-tensorflow-in-rust/28965>\
**Category:** General Discussion\
**Created:** [July 10, 2023, 3:12am UTC](https://discuss.ai.google.dev/t/error-building-tensorflow-in-rust/28965 "2023-07-10T03:12:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlo\_Jacobs](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/carlo_jacobs/32/13701_2.png) [@Carlo\_Jacobs](https://discuss.ai.google.dev/u/Carlo_Jacobs)\
**Post date:** [July 10, 2023, 3:12am UTC](https://discuss.ai.google.dev/t/error-building-tensorflow-in-rust/28965/1 "2023-07-10T03:12:11Z")

</div>

Hi!

- I am running an M1 Macbook Pro.
- I have installed Rust recently using Homebrew.
- I added `tensorflow = '0.20` to my `Cargo.toml` file

Upon calling `cargo build` I get this error:

` thread 'main' panicked at 'failed to execute cd "/Users/carlojacobs/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tensorflow-sys-0.23.0/target/source-v2.11.0" && "bazel" "build" "--jobs=8" "--compilation_mode=opt" "--copt=-march=native" "tensorflow:libtensorflow.dylib"', /Users/carlojacobs/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tensorflow-sys-0.23.0/build.rs:428:9`

Here is the Rust TF crate link: [https://tensorflow.github.io/rust/tensorflow/index.html#](https://tensorflow.github.io/rust/tensorflow/index.html#)

I have searched around a bit and read that it maybe has something to do with the fact that I’m on an M1 mac.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Carlo\_Jacobs](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/carlo_jacobs/32/13701_2.png) [@Carlo\_Jacobs](https://discuss.ai.google.dev/u/Carlo_Jacobs)\
**Post date:** [July 10, 2023, 3:13am UTC](https://discuss.ai.google.dev/t/error-building-tensorflow-in-rust/28965/2 "2023-07-10T03:13:17Z")

</div>

I’m on an M1 Macbook Pro. I’m trying to build the [Tensorflow crate for Rust](https://tensorflow.github.io/rust/tensorflow/index.html#)

I added `tensorflow = "0.20.0"` to my `Cargo.toml` and ran `cargo build` I’m getting this error.

 ![image](https://d3qe71uytubmmx.cloudfront.net/original/2X/3/3c615015259bcf63e65d0c7bb5d64d12189fbdfd.jpeg)

Any ideas?
