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

pip install fastapi[all] is failing due to a rust component?

您好,我正在尝试安装 fastapi,但安装 [= 时似乎失败了17=]orjson

这是完整的错误代码:

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

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

问题很明确:

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

将您的 Python 解释器升级到 64 位,或者使用 rustup 安装 32 位 Rust 目标

编辑: 是如何在 x86_64 机器上手动定位 32 位