python-3.x - 我无法在 Google Colab 中导入我的自定义模块
问题描述
我无法在 Google Colab 中导入我的自定义模块,我的代码中有什么错误
from google.colab import drive
drive.mount('/gdrive')
%cd /gdrive
import sys
sys.path.append('/gdrive/My Drive/Colab Notebooks')
from mylib import MyFunction
MyFunction()
ImportError Traceback (most recent call last)
<ipython-input-7-06da14aac3e5> in <module>()
----> 1 from mylib import MyFunction
2 MyFunction()
ImportError: cannot import name 'MyFunction'
解决方案
推荐阅读
- swift - 有条件地启用/禁用 Catalyst 菜单栏项
- c++ - 使用 constexpr + auto 作为返回和参数类型的奇怪类型推导
- javascript - 选中两个复选框时分配一个值
- python - avro-gen 生成的类性能
- java - SpringMVC 无法正确绑定 json
- amazon-web-services - 如何将 aws 凭证密钥传递给 KinesisProducerConfiguration 以在 Java 中创建 kinesis 生产者
- javascript - 当表单具有数据类型为“文本”的复选框和锚标记时如何添加验证
- amazon-web-services - Cloudwatch 用于基于使用 cloudwatch 指标的每日计费警报
- java - Java 验证方法并根据输入参数返回消息
- node.js - 谷歌云函数用40+函数写配额问题