rust 无法安装货物请求

rqcrx0a6  于 2023-03-30  发布在  其他
关注(0)|答案(1)|浏览(142)

我正在使用Oracle Linux 8.7并尝试安装the Rust HTTP client API styled after awesome Python request
我添加到Cargo.toml

requests = "0.0.30"

然后是cargo build命令

cargo build
    Updating crates.io index
error: failed to select a version for the requirement `security-framework = "^0.1.9"`
candidate versions found which didn't match: 2.8.2, 2.8.1, 2.8.0, ...
location searched: crates.io index
required by package `native-tls v0.1.0`
    ... which satisfies dependency `native-tls = "^0.1"` of package `hyper-native-tls v0.2.0`
    ... which satisfies dependency `hyper-native-tls = "^0.2"` of package `requests v0.0.30`
    ... which satisfies dependency `requests = "^0.0.30"` of package `project v0.1.0 (/home/opc/project)`

此外,尝试添加这些依赖项

[dependencies]
requests = "0.0.30"
native-tls = "0.2.11"
hyper-native-tls = "0.3.0"
security-framework = "^2.8.2"

但同样的错误也在发生

sczxawaw

sczxawaw1#

security-framework crate的所有0.1版本都已从crates.io中删除。我不知 prop 体细节,但我认为这是因为这些版本存在安全问题。这意味着新项目无法再下载它们,也无法使用依赖于security-framework的任何0.1版本的crate。比如native-tls的旧版本0.1.*(5年前)。requests crate已经有6年没有更新了。因此我认为它已经被放弃了。你应该寻找一个替代的HTTP客户端crate,比如流行的reqwest

相关问题