python-import - 如何在colab上安装utils?

标签 python-import google-colaboratory

如何在 google colab 上手动安装 util?

!pip install web.py==0.40.dev0
import utils

错误
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-13-a4c82eaa1619> in <module>()
     20 import torch.backends.cudnn
     21 get_ipython().system('pip install web.py==0.40.dev0')
---> 22 from Utils import *
     23 from PIL import Image
     24 from torch import nn

ModuleNotFoundError: No module named 'Utils'

---------------------------------------------------------------------------

如何正确纠正这个错误?

最佳答案

尝试更改为 !pip install python-utils 但

  Installing collected packages: python-utils
**Successfully installed python-utils-2.3.0**
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-e6796b5aa862> in <module>()
     20 import torch.backends.cudnn
     21 get_ipython().system('pip install python-utils')
---> 22 import utils
     23 from PIL import Image
     24 from torch import nn

ModuleNotFoundError: **No module named 'utils'**

关于python-import - 如何在colab上安装utils?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49094962/

相关文章:

python - 为什么导入模块会导致循环导入错误

python - 上传图片到google Colab,使用Keras进行分类预测

vulkan - 如何让 Vulkan API 在 Google Colab 中运行

python - 在 Google Colab 中使用 Python Github 存储库

python - 在 Python 中使用相互或循环(循环)导入时会发生什么?

python - 导入spaCy错误

python - 从另一个脚本导入变量并保持更新

python - 使用点符号导入

tensorflow - Google Colab - 您的 session 因未知原因崩溃

google-colaboratory - 如何在 google colab 中使用 JavaScript?