我想DataProcesser从load_data.pypython 文件运行一个函数,该文件可以在我的 google 驱动器路径中找到gdrive/My\ Drive/Colab\ Notebooks/CODEX/source/。
from google.colab import drive
drive.mount('/content/gdrive')
# Custom functions/classes
path_to_module = 'gdrive/My\ Drive/Colab\ Notebooks/CODEX/source/' # Path where all the .py files are, relative to the notebook folder
sys.path.append(path_to_module)
from load_data import DataProcesser
Run Code Online (Sandbox Code Playgroud)
追溯:
> --------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call
> last) <ipython-input-30-066e93c75b7d> in <module>()
> 20 path_to_module = 'gdrive/My\ Drive/Colab\ Notebooks/CODEX/source/' # Path where all the .py files are, relative
> to the notebook folder
> 21 sys.path.append(path_to_module) …Run Code Online (Sandbox Code Playgroud)