pip install fastapi[all] 由于 Rust 组件而失败?

Lea*_*oob 5 pip rust python-3.x orjson

您好,我正在尝试安装fastapi ,但在安装orjson时似乎失败

\n\n

这是完整的错误代码:

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

请让我知道我能做什么?我已经安装了 rustup 并将其设置为每晚。非常感谢您的帮助,谢谢!

\n