Who can help with the task?

was ist an der ausgabe falsch FileNotFoundError Traceback (most recent call last) Cell In[4], line 1 ----> 1 with open("../data/dictionary.txt", 'r') as file: 2 for line in file: 3 word = line.strip() File ~\anaconda3\Lib\site-packages\IPython\core\interactiveshell.py:324, in _modified_open(file, *args, **kwargs) 317 if file in {0, 1, 2}: 318 raise ValueError( 319 f"IPython won't let you open fd={file} by default " 320 "as it is likely to crash IPython. If you know what you are doing, " 321 "you can use builtins' open." 322 ) --> 324 return io_open(file, *args, **kwargs) FileNotFoundError: [Errno 2] No such file or directory: '../data/dictionary.txt'

[ ]:

Why is there an error shown? Does anyone have a solution? The file is there, that's why it should actually show it. It's exactly as shown in the video.

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
9 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
TheLinuxer
9 months ago

The path is incorrectly specified or the file “dictionary.txt” does not exist. Check again if the path is correctly specified.

The current path says: Go back a directory from where the Python file is > go to “data” > There is the file.

Maybe the file doesn’t exist.

If the file is there:

You may not have to go back (I don’t know your folder structure). Try “data/dictionary.txt” without “../”. Otherwise try other paths.

TheLinuxer
9 months ago
Reply to  gutefrage108

I don’t know your folder structure. That was just a suggestion you could do.

“..” means going back a directory. “/” only separates the parts of the path.

Destranix
9 months ago

Probably the file does not exist or the path is incorrectly specified.

Destranix
9 months ago
Reply to  gutefrage108

Then the path will not fit.

Dultus, UserMod Light

Hello dear,

the file is clearly not available.

Are you sure you want to get a folder higher and then in data/ for a “dictionary.txt”?

Best regards

Dultus, UserMod Light
Reply to  gutefrage108

But if it were to explain – you are probably not in the right directory to work from there, but somewhere with Jupyter.