5

Hi I'm trying to install fastapi, but it seems to be failing when im installing orjson

Here is the full error code:

Building wheel for orjson (PEP 517) ... error ERROR: Command errored out with exit status 1: command: 'd:\pythonapps\fastapi_tutorial\env\scripts\python.exe' 'd:\pythonapps\fastapi_tutorial\env\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\User\AppData\Local\Temp\tmp4yope0de' cwd: C:\Users\User\AppData\Local\Temp\pip-install-35a1h4do\orjson Complete output (50 lines): Compiling cfg-if v0.1.10 Compiling winapi v0.3.8 Compiling bitflags v1.2.1 Compiling ryu v1.0.5 Compiling scopeguard v1.1.0 Compiling packed_simd v0.3.3 Compiling serde v1.0.111 Compiling lexical-core v0.7.4 Compiling libc v0.2.71 Compiling version_check v0.9.2 Compiling smallvec v1.4.0 Compiling arrayvec v0.5.1 Compiling encoding_rs v0.8.23 Compiling static_assertions v1.1.0 Compiling itoa v0.4.5 Compiling orjson v3.1.0 (C:\Users\User\AppData\Local\Temp\pip-install-35a1h4do\orjson) Compiling rand_core v0.4.2 Compiling inlinable_string v0.1.11 Compiling associative-cache v1.0.1 Compiling once_cell v1.4.0 Compiling lock_api v0.3.4 Compiling wyhash v0.3.0 Compiling pyo3 v0.10.1 error: failed to run custom build command for `pyo3 v0.10.1` Caused by: process didn't exit successfully: `C:\Users\User\AppData\Local\Temp\pip-install-35a1h4do\orjson\target\release\build\pyo3-dde0edb355843ae5\build-script-build` (exit code: 1) --- stderr Error: "Your Rust target architecture (64-bit) does not match your python interpreter (32-bit)" warning: build failed, waiting for other jobs to finish... thread 'rustc' panicked at 'Box<Any>', src\librustc_errors\lib.rs:912:9 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports note: rustc 1.46.0-nightly (4fb54ed48 2020-06-14) running on x86_64-pc-windows-msvc note: compiler flags: -Z mutable-noalias -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1 --crate-type lib note: some of the compiler flags provided by cargo are hidden error: build failed 💥 maturin failed Caused by: Failed to build a native library through cargo Caused by: Cargo build finished with "exit code: 101": `cargo rustc --message-format json --manifest-path Cargo.toml --lib --release -- -C link-arg=-s` Running `maturin pep517 build-wheel -i python --manylinux=off --strip=on` Error: Command '['maturin', 'pep517', 'build-wheel', '-i', 'python', '--manylinux=off', '--strip=on']' returned non-zero exit status 1. ---------------------------------------- ERROR: Failed building wheel for orjson Failed to build orjson ERROR: Could not build wheels for orjson which use PEP 517 and cannot be installed directly 

Please let me know what could I do? I have installed rustup and set it to nightly. Any help is greatly appreciated Thank you!

1
  • 1
    Seems the issue is that rust is 64-bit while python is 32-bit I'd upgrade to 64-bit and check if it solves the issue. Commented Jun 15, 2020 at 5:17

1 Answer 1

4

The problem is quite clear:

Your Rust target architecture (64-bit) does not match your python interpreter (32-bit)

Either upgrade your Python interpreter to 64 bit, or use rustup to install a 32 bit Rust target

Edit: Here is how you could manually target 32 bit on a x86_64 machine

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.