Question: I don't know what's wrong here, all I'm trying to do is to open this file, but it says it can't find such a file or directory, however as I have highlighted on the side, the file is right there. I just want to open it. I have opened files before but never encountered this. I must have missed something, I checked online, and seems like my syntax is correct, but I don't know.

I get the same error when I try with "alphabetical\_words" which is just a text file.

[![enter image description here](https://i.stack.imgur.com/qllVh.png)](https://i.stack.imgur.com/qllVh.png)

Answer: 
When [open()](https://docs.python.org/3/library/functions.html#open) function receives a relative path, it looks for that file relative to the current working directory. In other words: relative to the current directory from where the script is run. This can be any arbitrary location.

I guess what you want to do is look for `alphabetical.csv` file relative to the script location. To do that use the following formula:

```py
from pathlib import Path

# Get directory of this script
THIS_DIR = Path(__file__).absolute().parent
# Get path of CSV file relative to the directory of this script
CSV_PATH = THIS_DIR.joinpath("alphabetical.csv")
# Open the CSV file using a with-block
with CSV_PATH.open(encoding="utf-8") as csvfile:
    pass  # Do stuff with opened file

```
You need to import csv. Then you can open the file as a csv file. For example,

```py
with open ("alphabetical.csv", "r") as csvfile:

```

Then you can use the file.

Make sure the file is in your cwd.