pip install github上资源库报错,解决 surface-distance计算库调用中的一些问题解决fatal: destination path ‘surface-distance

文章讲述了在使用surface_distance库时遇到的编译错误,需先从GitHub克隆并安装,过程中需设置网络代理以解决已存在非空目录错误,成功安装后头文件调用不再报错。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我们在运行代码中发现,头文件如下代码

import surface_distance
from surface_distance import metrics



            ssd = surface_distance.compute_surface_distances((seg == 1)[0, 0].cpu().numpy(),
                                                             (masks==1)[0, 0].cpu().numpy(),
                                                             spacing_mm=spacing[0].numpy())
            nsd = metrics.compute_surface_dice_at_tolerance(ssd, args.tolerance)  

直接运行会报错,需要安装库

我们直接查询到github的链接

https://github.com/google-deepmind/surface-distance

直接按照github链接安装

git clone https://github.com/deepmind/surface-distance.git
pip install surface-distance/

报错:fatal: destination path 'surface-distance' already exists and is not an empty directory.

这时候需要设置网络代理

在cmd命令行中输入

git config --global http.proxy http://127.0.0.1:7890

 再次按照github链接安装

git clone https://github.com/deepmind/surface-distance.git
pip install surface-distance/

就可以成功装上库!!

再次调用头文件就不会报错

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值