我无法在Google Colab中导入自定义模块

时间:2020-07-28 05:38:23

标签: python-3.x import module google-colaboratory

我无法在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'

0 个答案:

没有答案