【问题标题】:Why am I getting a ERNO fileNotFoundException, when the file is in the same folder as the .ipynb notebook?当文件与 .ipynb 笔记本位于同一文件夹中时,为什么我会收到 ERNO fileNotFoundException?
【发布时间】:2021-09-28 23:14:28
【问题描述】:

我正在尝试通过 requirements.txt 文件安装依赖项。 但是我遇到了找不到文件的错误(我正在使用 Google Collab)。

!pip install -r ./requirements.txt

我收到此错误:

错误:无法打开需求文件:[Errno 2] 没有这样的文件或目录:'requirements.txt'

但它们都在同一个文件夹中

我在关注this post

【问题讨论】:

  • !pwd ? !ls ?

标签: python pip


【解决方案1】:

不确定这是否是 Google Collab 的问题,但我所要做的就是确保指向文件夹的路径所有文件都在 [即使 ipynb 文件与requirements.txt]:示例:

cd '/content/drive/MyDrive/Colab Notebooks/name/name_of_folder_with_all_files'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多