Skip to content

pip install 报错 #13

Description

@tuhao1020

执行pip install -e ".[all]"时报错:

Preparing metadata (pyproject.toml) ... error
    error: subprocess-exited-with-error

    × Preparing metadata (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [37 lines of output]
        warning: /Users/tuhao/.cargo/config is deprecated in favor of config.toml
          |
          = help: if you need to support cargo 1.38 or earlier, you can symlink config to config.toml
        warning: /Users/tuhao/.cargo/config is deprecated in favor of config.toml
          |
          = help: if you need to support cargo 1.38 or earlier, you can symlink config to config.toml
            Updating ustc index
        warning: spurious network error (3 tries remaining): could not read refs from remote repository; class=Net (12); code=Eof (-20)
        warning: spurious network error (2 tries remaining): could not read refs from remote repository; class=Net (12); code=Eof (-20)
        warning: spurious network error (1 try remaining): could not read refs from remote repository; class=Net (12); code=Eof (-20)
        error: failed to get asn1 as a dependency of package cryptography-rust v0.50.1 (/private/var/folders/lt/gstgm3fd0jj5hlcz0ryw6fxm0000gn/T/pip-install-6_3gxu_1/cryptography_a8f731faf98f423ab929264c8777495c/src/rust)

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

    Caused by:
      unable to update registry `crates-io`

    Caused by:
      failed to query replaced source registry `crates-io`

    Caused by:
      failed to fetch `git://mirrors.ustc.edu.cn/crates.io-index`

    Caused by:
      network failure seems to have happened
      if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
      https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

    Caused by:
      could not read refs from remote repository; class=Net (12); code=Eof (-20)
    💥 maturin failed
      Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
      Caused by: `cargo metadata` exited with an error:
    Error running maturin: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/private/var/folders/lt/gstgm3fd0jj5hlcz0ryw6fxm0000gn/T/pip-modern-metadata-kfvrqmzn', '--interpreter', '/Users/tuhao/dev/ProtoForge/venv/bin/python3.14']' returned non-zero exit status 1.
    Checking for Rust toolchain....
    Running `maturin pep517 write-dist-info --metadata-directory /private/var/folders/lt/gstgm3fd0jj5hlcz0ryw6fxm0000gn/T/pip-modern-metadata-kfvrqmzn --interpreter /Users/tuhao/dev/ProtoForge/venv/bin/python3.14`
    [end of output]
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: metadata-generation-failed

  × Encountered error while generating package metadata.
  ╰─> cryptography

  note: This is an issue with the package mentioned above, not pip.
  hint: See above for details.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions