如何解决将python模块导入colab-ModuleNotFoundError
我正在尝试将colab文件作为具有要在此新colab文件中使用的功能(def)的模块导入。
from google.colab import drive
drive.mount('/content/drive')
我尝试了所有这些呼叫:
#!cp "drive/My Drive/Colab Notebooks/Aulas_Cursos/test_module" .
!cp '/content/drive/My Drive/Colab Notebooks/Aulas_Cursos/test_module' .
#import sys
#sys.path.insert(0,'/content/drive/My Drive/ColabNotebooks/Aulas_Cursos')
#sys.path.append('/content/gdrive/My Drive')
import test_module
但是我遇到了同样的错误:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-42-1a0689a1a9af> in <module>()
----> 1 import test_module
ModuleNotFoundError: No module named 'test_module'
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package,you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies,click the
"Open Examples" button below.
---------------------------------------------------------------------------
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。