Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/rust/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x pip安装fastapi[all]因组件生锈而失败?_Python 3.x_Rust_Pip_Orjson - Fatal编程技术网

Python 3.x pip安装fastapi[all]因组件生锈而失败?

Python 3.x pip安装fastapi[all]因组件生锈而失败?,python-3.x,rust,pip,orjson,Python 3.x,Rust,Pip,Orjson,您好,我正在尝试安装fastapi,但当我安装或json时,它似乎失败了 以下是完整的错误代码: 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\li

您好,我正在尝试安装fastapi,但当我安装或json时,它似乎失败了

以下是完整的错误代码:

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
为orjson(PEP 517)构建轮子。。。错误
错误:命令出错,退出状态为1:
命令:“d:\pythonapps\fastapi\u tutorial\env\scripts\python.exe”d:\pythonapps\fastapi\u tutorial\env\lib\site packages\pip\\u vendor\pep517\\u in\u process.py“build\u wheel”C:\Users\User\AppData\Local\Temp\tmp4yope0de”
cwd:C:\Users\User\AppData\Local\Temp\pip-install-35a1h4do\orjson
完整输出(50行):
在v0.1.10中编译cfg
编译winapi v0.3.8
编译位标志v1.2.1
编译Ryuv1.0.5
编译scopeguard v1.1.0
编译压缩单指令多数据手册v0.3.3
编译serde v1.0.111
编译词汇核心v0.7.4
编译libc v0.2.71
编译版本检查v0.9.2
编译smallvec v1.4.0
编译arrayvec v0.5.1
编译编码_rs v0.8.23
编译静态断言v1.1.0
编制itoa v0.4.5
编译orjson v3.1.0(C:\Users\User\AppData\Local\Temp\pip-install-35a1h4do\orjson)
编译rand_core v0.4.2
编译可插入的_字符串v0.1.11
编译关联缓存v1.0.1
编译一次单元v1.4.0
编译锁api v0.3.4
编译wyhash v0.3.0
编制pyo3 v0.10.1
错误:无法为“pyo3 v0.10.1”运行自定义生成命令`
原因:
进程未成功退出:`C:\Users\User\AppData\Local\Temp\pip-install-35a1h4do\orjson\target\release\build\pyo3-dde0edb35843ae5\build script build`(退出代码:1)
---斯特德尔
错误:“Rust目标体系结构(64位)与python解释器(32位)不匹配”
警告:生成失败,正在等待其他作业完成。。。
线程'rustc'在'Box'处惊慌失措,src\librustc\u errors\lib.rs:912:9
注意:使用'RUST_BACKTRACE=1'环境变量运行以显示回溯
注意:编译器出人意料地惊慌失措。这是一个错误。
注意:如果您能提供错误报告,我们将不胜感激:https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-报告
注:rustc 1.46.0每晚(4fb54ed48 2020-06-14)在x86_64-pc-windows-msvc上运行
注意:编译器标志:-Z可变noalias-C opt level=3-C panic=abort-C链接器插件lto-C codegen units=1——板条箱类型库
注意:cargo提供的一些编译器标志是隐藏的
错误:生成失败
到期日失败
原因:未能通过cargo构建本机库
原因:Cargo构建以“退出代码:101”完成:`Cargo rustc--消息格式json--manifest path Cargo.toml--lib--release--C link arg=-s`
运行'durin pep517 build wheel-i python--manylinux=off--strip=on`
错误:命令“['durin'、'pep517'、'build wheel'、'-i'、'python'、'-manylinux=off'、'-strip=on']”返回非零退出状态1。
----------------------------------------
错误:为orjson生成控制盘失败
未能生成orjson
错误:无法为使用PEP 517且无法直接安装的orjson构建控制盘

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

问题很明显:

您的目标体系结构(64位)与python解释器(32位)不匹配

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


编辑:是如何在x86_64机器上手动将32位作为目标的

问题很明显:

您的目标体系结构(64位)与python解释器(32位)不匹配

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


编辑:是如何在x86_64机器上手动将32位作为目标的

问题似乎是rust是64位而python是32位,我将升级到64位并检查它是否解决了问题。问题似乎是rust是64位而python是32位,我将升级到64位并检查它是否解决了问题。