cargo install报错:failed to run custom build command for ‘xx‘ | process didn‘t exit successfully:‘xx‘

报错命令:

cargo install --force --locked cargo-contract --version 1.5.0

报错信息:

error: failed to run custom build command for `cargo-contract v1.5.0`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installPoUW8y/release/build/cargo-contract-219601312e397f60/build-script-build` (exit status: 1)
  --- stdout
  cargo:warning=Git command failed with status: exit status: 128
  cargo:rustc-env=CARGO_CONTRACT_CLI_IMPL_VERSION=1.5.0-unknown-x86_64-unknown-linux-gnu
  cargo:warning=Could not find `.git/HEAD` searching from `/home/echo/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/cargo-contract-1.5.0` upwards!
  Creating template zip: template_dir '/home/echo/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/cargo-contract-1.5.0/templates/new', destination archive '/tmp/cargo-installPoUW8y/release/build/cargo-contract-85ed6dd04fe1327e/out/template.zip'
  Done: /home/echo/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/cargo-contract-1.5.0/templates/new written to /tmp/cargo-installPoUW8y/release/build/cargo-contract-85ed6dd04fe1327e/out/template.zip
  Setting cargo working dir to '/home/echo/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/cargo-contract-1.5.0/ink_linting'
  Invoking cargo: "cargo" "build" "--release" "--locked" "--target-dir=/tmp/cargo-installPoUW8y/release/build/cargo-contract-85ed6dd04fe1327e/out" "--manifest-path=/home/echo/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/cargo-contract-1.5.0/ink_linting/Cargo.toml"
error: failed to get `clippy_utils` as a dependency of package `ink_linting v0.1.0 (/home/echo/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/cargo-contract-1.5.0/ink_linting)`

  Caused by:
    failed to load source for dependency `clippy_utils`

  Caused by:
    Unable to update https://github.com/rust-lang/rust-clippy?rev=0cb0f7636851f9fcc57085cf80197a2ef6db098f#0cb0f763

  Caused by:
    failed to clone into: /home/echo/.cargo/git/db/rust-clippy-4b72815e96774b3d

  Caused by:
    process didn't exit successfully: `git fetch --force --update-head-ok 'https://github.com/rust-lang/rust-clippy' '+0cb0f7636851f9fcc57085cf80197a2ef6db098f:refs/commit/0cb0f7636851f9fcc57085cf80197a2ef6db098f'` (exit status: 128)
    --- stderr
    error: 预期仍然需要 1330 个字节的正文
    fetch-pack: unexpected disconnect while reading sideband packet
    fatal: 过早的文件结束符(EOF)
    fatal: fetch-pack:无效的 index-pack 输出
  Encountered error: `"cargo" "build" "--release" "--locked" "--target-dir=/tmp/cargo-installPoUW8y/release/build/cargo-contract-85ed6dd04fe1327e/out" "--manifest-path=/home/echo/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/cargo-contract-1.5.0/ink_linting/Cargo.toml"` failed with exit code: Some(101)
error: failed to compile `cargo-contract v1.5.0`, intermediate artifacts can be found at `/tmp/cargo-installPoUW8y`

解决方法:

rustup update

重新cargo install,成功

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
引用\[1\]和\[2\]提供了关于安装cryptography库的指南。根据这些指南,您需要执行以下步骤来安装cryptography库: 1. 安装必要的依赖项:在Linux系统上,您可以使用以下命令安装依赖项: ``` $ apk add gcc musl-dev python3-dev libffi-dev openssl-dev cargo ``` 在Windows系统上,您可以按照\[3\]中提供的链接下载并安装Microsoft Visual C++ Build Tools。 2. 更新pip:使用以下命令更新pip: ``` $ pip install --upgrade pip ``` 3. 安装cryptography库:使用以下命令安装cryptography库: ``` $ pip install cryptography ``` 如果您在安装过程中遇到问题,请确保按照指南中的步骤进行操作,并检查您的系统是否满足所有要求。 关于您提到的错误信息"Failed to build pycocotools ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed direct",这是由于pycocotools库使用了PEP 517来构建wheels,而无法直接安装。解决此问题的一种方法是手动构建和安装pycocotools库。您可以按照以下步骤尝试解决此问题: 1. 克隆pycocotools库的GitHub存储库:使用以下命令克隆存储库: ``` $ git clone https://github.com/cocodataset/cocoapi.git ``` 2. 进入cocoapi/PythonAPI目录:使用以下命令进入目录: ``` $ cd cocoapi/PythonAPI ``` 3. 执行以下命令来构建和安装pycocotools库: ``` $ python setup.py build_ext --inplace $ python setup.py install ``` 这将手动构建并安装pycocotools库。 请注意,这些解决方法是基于提供的引用内容,并可能因操作系统和环境的不同而有所变化。如果您遇到任何问题,请参考引用\[1\]和\[2\]中提供的官方文档或寻求相关支持。 #### 引用[.reference_title] - *1* *2* [ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly](https://blog.csdn.net/yunweigo/article/details/118416806)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [ERROR: Could not build wheels for pycocotools which use PEP 517 and cannot be installed directl](https://blog.csdn.net/weixin_44512987/article/details/128090249)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值