Quantcast
Viewing all articles
Browse latest Browse all 14185

FileNotFoundError: [Errno 2] No such file or directory: 'Test.csv' in VS Code

I was trying to read from a .csv file and wrote a very basic code.

import csvwith open('Test.csv', 'r') as csv_file:    csv_reader = csv.reader(csv_file)    for line in csv_reader:        print(line)

Both the test.csv and my .py file is in the same directory. For some reason when I run this in vs code, it pops up an error:

FileNotFoundError: [Errno 2] No such file or directory: 'Test.csv'

But the same code works perfectly fine with sublime text. I'd like to use Vs code for my future projects so it will be helpful if someone can solve this issue. Thank you.


Viewing all articles
Browse latest Browse all 14185

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>