在64位Mac OSX上的64位python解释器上构建“orjson”时,requirement.txt安装失败

2024-06-01 04:12:56 发布

您现在位置:Python中文网/ 问答频道 /正文

正在为项目运行requirements.txt安装(Fast API)。以下面的错误结束。我试着从https://github.com/rust-lang/rust/issues/61925开始接近 我使用仍然面临错误的rustup override set nightly将rust设置为“夜间”

  Using cached orjson-3.4.3.tar.gz (1.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python@3.8/bin/python3.8 /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/tmpwyr1rz66
         cwd: /private/var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/pip-install-qmnttz7p/orjson
    Complete output (13 lines):
    💥 maturin failed
      Caused by: Cargo metadata failed. Do you have cargo in your PATH?
      Caused by: Error during execution of `cargo metadata`: error: failed to run `rustc` to learn about target-specific information
    
    Caused by:
      process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -Z mutable-noalias --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
      --- stderr
      error: the option `Z` is only accepted on the nightly compiler
    
    
    Checking for Rust toolchain....
    Running `maturin pep517 write-dist-info --metadata-directory /private/var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/pip-modern-metadata-c1upg8fc --interpreter /usr/local/Cellar/python@3.8/3.8.6_2/bin/python3.8 --manylinux=off --strip=on`
    Error: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/private/var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/pip-modern-metadata-c1upg8fc', '--interpreter', '/usr/local/Cellar/python@3.8/3.8.6_2/bin/python3.8', '--manylinux=off', '--strip=on']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python@3.8/bin/python3.8 /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/tmpwyr1rz66 Check the logs for full command output.

请告知! 谢谢大家!


Tags: pipbuildforbinvarusrlocaltype
1条回答
网友
1楼 · 发布于 2024-06-01 04:12:56

这个错误似乎与使用“Z”选项的durimin命令有关,该选项仅适用于夜间编译器。您可以先尝试安装

安装夜间工具链:

rustup install nightly

切换到夜间工具链作为默认工具链:

rustup default nightly

然后尝试安装这些依赖项。希望这能奏效

相关问题 更多 >