FileNotFoundError: [Errno 2] No such file or directory:

preview_player
Показать описание
Hello everyone, today's video is a short one on an error that I got during my last project. I have been short on time lately with classes and the holidays coming up. If you are new to Python or using CSV files or other text files in your projects then this video will be great for you. Let me know how you guys are doing in the comments are you all ready for Christmas!

Peter-Pyke on GitHub
Рекомендации по теме
Комментарии
Автор

great content...
If you wanted clarification on the path string you should prefix it with 'r'; this specifies raw string. Now the backslash characters will be read as literal backlashes (otherwise the interpreter would think its part of the escape sequence and an error would occur. )
cheers!

PauBer
Автор

Changing the slashes solved my issue! I'm not running the same editor so idk about the settings. The other videos I watched with my editor didn't work. So thank you for solving this after many Google and Youtube searches on my end!!

toya
Автор

thank you so much you have no idea how much this error was annoying me. - still new to python but this really did help

Dirklus
Автор

Very useful bro, thanks for explaining. I have subscribed your channel

rominmenezesromin
Автор

Thank yoy so much my friend, you´re awesome!

dealkor
Автор

my man is working for some alien company

ssublexff
Автор

that help me to solve my error. after 5 videos. thanks

denverli
Автор

Hello i literally figured it out seconds after I commented this video. I am using VS code and there is a setting called Python>Terminal:Execute in File Dir. It is unchecked by default and what it does is executes a file in the terminal from that current file. When you check the box it will then execute from the directory that file is located in, thus will find any txt file you want to open in your program. Such a frustrating error and its silly that VS code doesn't make it self-explanatory.

PeenTip
Автор

how can i solve it in vs code and for txt files!

api
Автор

Спасибо брат, я 3 часа сижу над этой ошибкой

MIIFPGame
Автор

Great video!
I've realized that in my case this issue was because of the "[" or "]" in the folder name. When I removed it, the issue stopped. Do you now why this happens?

daviprotasio_
Автор

Hi sir! I want help from you ...i face the same error filenotfound error but it but not resolving

rimshaafzal
Автор

Yeah this error is frustrating and I like the idea of using the absolute path but its not efficient when you have the file in the directory you are working in. So a solution is much better that a patch but, I thank you for trying but your fix didn't work for me.

PeenTip
Автор

thank you first for this video, but it doesnt work with me gave me the same error . could you please help me

suhailabessa
Автор

could you please help me to run a python program?

mehedihassan