github - 为什么即使在正确安装后我也会收到 ModuleNotFoundError?
问题描述
我使用以下命令从 GitHub安装了一个名为External-Attention-pytorch的包
!pip install git+https://github.com/xmu-xiaoma666/External-Attention-pytorch
它成功执行并给出以下输出
Collecting git+https://github.com/xmu-xiaoma666/External-Attention-pytorch
Cloning https://github.com/xmu-xiaoma666/External-Attention-pytorch to /tmp/pip-req-build-lwv6us0o
Running command git clone -q https://github.com/xmu-xiaoma666/External-Attention-pytorch /tmp/pip-req-build-lwv6us0o
后来我尝试使用以下行从已安装的包中导入一个函数
from fightingcv.attention.gfnet import GFNet
这会导致以下错误:
ModuleNotFoundError: No module named 'fightingcv.attention'
这里有什么问题?以及如何克服它?
请注意,如果需要,我会在 Google Colab 中进行。
解决方案
推荐阅读
- python - 如何在 python 中自动理解 Fire base 实时数据库上的值由 android App 更新
- google-chrome - 调用 AWS Lambda 容器映像时进程退出并显示错误代码 100
- reactjs - 如何从链接嵌入或获取元数据?
- python - RecursionError:最大递归深度超出了python属性getter setter
- android - 如何将我的 Recycler View 设计为与 Chanel App 的此设计相似?
- css - v-expansion-panel-header 中的图标占用了太多空间
- azure - Azure SQL——实际上什么是 vCore
- ios - 在范围内找不到“BGTaskScheduler”
- java - Java中的简单座位预订
- python - 预期的 str、bytes 或 os.PathLike 对象,而不是 QuerySet