如果没有“Errno 2”,则无法导航到 Google Colab 中的特定文件夹

问题描述

抱歉,如果这是一个非常初级的问题,但我正在尝试将目录从 /content/drive/testing/catdeform/code/util/figure_code' 更改为 content/drive/testing/catdeform/code

到目前为止,我的步骤对这种情况没有帮助。 当我这样做时:

%cd drive

我得到了:

[Errno 2] No such file or directory: 'drive'
/content/drive/testing/catdeform/code/util/figure_code'

然后我做到了

$cd ~

它在 Colab 单元控制台中给出了输出 root

现在,如果我尝试,例如

%cd /drive/testing/catdeform/code

它给出输出

[Errno 2] No such file or directory: '/drive/testing/catdeform/code'
/root

如果我做了 %cd code 那么这给了我

[Errno 2] No such file or directory: '/code'
/root

我很困惑。我如何直接进入 '/drive/testing/catdeform/code' 文件夹而不出现问题?

解决方法

我认为您必须以 /content/ 开始通话才能专门去某个地方。所以,

%cd /content/drive/testing/catdeform/code/

终于让我找到了正确的位置。我希望这个方法对我继续有效!