0

I'm trying to install dependencies via a requirements.txt file. But I'm running into an error where the file is not found (I'm using Google Collab).

!pip install -r ./requirements.txt

I obtain this error:

ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'

But they are both in the same folder

I was following this post.

halfer
  • 19,824
  • 17
  • 99
  • 186
Katie Melosto
  • 1,047
  • 2
  • 14
  • 35

1 Answers1

0

Not sure if this is a Google Collab thing, but all I had to do to fix this was to make sure the path pointed to the folder all the files were in [even though the ipynb file was in the same folder as the requirements.txt]: example:

cd '/content/drive/MyDrive/Colab Notebooks/name/name_of_folder_with_all_files'
Katie Melosto
  • 1,047
  • 2
  • 14
  • 35