Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Python
  3. Question
Python

Python open() gives IOError: Errno 2 No such file or directory

Asked by Al German Dec 8, 2020 775 views 1 answer
Share

About this question

For some reason my code is having trouble opening a simple file:

This is the code:

file1 = open('recentlyUpdated.yaml')

And the error is:

IOError: [Errno 2] No such file or directory: 'recentlyUpdated.yaml'

  • Naturally, I checked that this is the correct name of the file.

  • I have tried moving around the file, giving open() the full path to the file and none of it seems to work.

Your answer

1 Answer

More Python discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Python Blogs

Guides, tips and career advice on Python from JanBask experts.