maybe try w+ instead of w? Like this:

import csv

with open('mycsv.csv', 'w+') as f:
    writer = csv.writer(f)
    writer.writerow(['col1', 'col2', 'col3'])
    writer.writerow(['one', 'two', 'three'])`

w+ forces python to create a new file if that file doesn't exist yet.

Answer from Matthijs990 on Stack Overflow
๐ŸŒ
Class Ace
classace.io โ€บ answers โ€บ how-do-you-create-a-new-csv-file-in-vs-code
Answers to: How do you create a new csv file in vs code?
April 25, 2024 - To create a new CSV file in VS ... icon in the activity bar on the side of the VS Code window. 3. Right-click on the folder where you want to create the new file and select "New File" from the context menu....
๐ŸŒ
YouTube
youtube.com โ€บ watch
How to create csv file in visual studio code in python ...
To learn more, please visit the YouTube Help Center: https://www.youtube.com/help
Discussions

Brand new to vscode. How do you export results into a CSV?
https://code.visualstudio.com/docs ... RTFD? More on reddit.com
๐ŸŒ r/vscode
2
0
December 11, 2023
Cannot create csv file from python in visual studio code - Stack Overflow
I am a beginner learning programming through CS50, currently on week 7 SQL. I am trying to apply some basic principles on my own machine instead of CS50 IDE on AWS to make sure I can use other More on stackoverflow.com
๐ŸŒ stackoverflow.com
New to using Python with VS Code and need help with CSV files
please refer to Data Science Tutorial More on reddit.com
๐ŸŒ r/vscode
2
0
October 12, 2020
Do I need to download plugins in VSCode to use csv files?
A CSV file is just a plain text file, you can use any text editor for it, VSCode included. There are plugins that ake it nicer to use, though. More on reddit.com
๐ŸŒ r/vscode
4
1
November 26, 2023
๐ŸŒ
Medium
medium.com โ€บ @noueruzzaman โ€บ learn-how-run-csv-file-with-pandas-in-vs-code-includes-topic-on-using-kernels-6f99fd962883
Learn how to run csv file with Pandas in VS Code (includes topic on using kernels)! | by Nouer Uz Zaman | Medium
August 22, 2024 - If you want to start fresh and write the code from the scratch then you can instead click on โ€˜New fileโ€™ option. Then click on Python File option. That opens python language in the tab. ... Now you want to work with new csv file which you can use for data manipulation.
๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ brand new to vscode. how do you export results into a csv?
r/vscode on Reddit: Brand new to vscode. How do you export results into a CSV?
December 11, 2023 -

I'm trying to pull some data for a work project and export it into a csv file, but I have literally no idea how. I'm running sql queries, and I've got all of the data coming through in the results tab, but I can't find a way to export this data. Any advice?

๐ŸŒ
Visual Studio Marketplace
marketplace.visualstudio.com โ€บ items
CSV - Visual Studio Marketplace
Extension for Visual Studio Code - Seamlessly Display and Edit CSVs
๐ŸŒ
YouTube
youtube.com โ€บ bald. bearded. builder.
Mastering CSV with VS Code - YouTube
Editing delimited files can be a pain, especially if they are large. The Rainbow CSV extension makes searching and viewing delimited files super nice. Queryi...
Published ย  April 8, 2021
๐ŸŒ
Visual Studio Marketplace
marketplace.visualstudio.com โ€บ items
vscode-edit-csv
Visual Studio Code>Other>Edit CSVNew to Visual Studio Code?
Find elsewhere
๐ŸŒ
YouTube
youtube.com โ€บ in-tech-gration
VSCode: Working efficiently with CSV files - YouTube
Working efficiently with plain text CSV files (.csv) using VSCode.Extensions:- Rainbow CSV: https://marketplace.visualstudio.com/items?itemName=mechatroner.r...
Published ย  September 21, 2023
Views ย  544
๐ŸŒ
DEV Community
dev.to โ€บ yogski โ€บ data-wrangling-with-vscode-yes-really-2bbf
Data Wrangling with VSCode (Yes, Really!) - DEV Community
August 17, 2021 - Use CSV Lint from ctrl + shift + P or menu at bottom of VSCode window to check any incorrect row. Save as csv file, and we're done!
๐ŸŒ
Wordpress
unhandledsunshine.wordpress.com โ€บ 2023 โ€บ 09 โ€บ 29 โ€บ import-data-with-vs-code
Private Site
Build a website. Sell your stuff. Write a blog. And so much more ยท This site is currently private. Log in to WordPress.com to request access
๐ŸŒ
YouTube
youtube.com โ€บ watch
JSON to CSV Made Easy โ€” One Click Conversion in VS Code! - YouTube
Get the full source code of application here:Watch My Visual Studio Code IDE Setup Video For Fonts,Themes & Extensionshttps://youtu.be/Bon8Pm1gbX8Hi Join the...
Published ย  March 11, 2025
๐ŸŒ
YouTube
youtube.com โ€บ avinash ketkar
Editing CSV in Visual Studio Code - YouTube
CSV ( Comma Separated Values) file can be viewed and edited right in Visual Studio Code , just like in Excel, with some limitations.
Published ย  December 30, 2022
Views ย  1K
๐ŸŒ
Visual Studio Marketplace
marketplace.visualstudio.com โ€บ items
Rainbow CSV - Visual Studio Marketplace
Extension for Visual Studio Code - Highlight CSV and TSV files, Run SQL-like queries
๐ŸŒ
YouTube
youtube.com โ€บ code 2020
VS Code tips โ€” The Rainbow CSV extension - YouTube
The Rainbow CSV extension for #vscode adds syntax highlighting to each column of data in CSV files, making them much more readable.You can also hover over co...
Published ย  June 21, 2022
Views ย  19K
๐ŸŒ
Brainly
brainly.com โ€บ computers and technology โ€บ high school โ€บ how do you open a csv file in visual studio code?
[FREE] How do you open a CSV file in Visual Studio Code? - brainly.com
Learn more about Opening CSV in Visual Studio Code here: ... To open a CSV file in Visual Studio Code, either right-click the file and choose 'Open with' > 'Visual Studio Code', or use 'File' > 'Open File...' within VS Code to select your CSV.
๐ŸŒ
TechBloat
techbloat.com โ€บ home โ€บ how to add a csv file in vs code
How to Add a CSV File in VS Code - TechBloat
January 13, 2026 - Before starting, ensure you have VS Code installed on your computer. If not, download it from the official website and complete the setup. Once installed, you can add CSV files by opening existing files from your file system or by creating new ones directly within VS Code.
๐ŸŒ
YouTube
youtube.com โ€บ watch
VS Code: Importing CSV files to make a SQLite Database - YouTube
In this video we use VS Code with two SQLite extensions to import a CSV (comma separated values) file to create a table in a database. The first row of the ...
Published ย  December 2, 2024
๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ new to using python with vs code and need help with csv files
r/vscode on Reddit: New to using Python with VS Code and need help with CSV files
October 12, 2020 -

So I made a simple chart thing using matplotlib and pandas and it all works well in PyCharm.

I copied the same code over to VS Code and also moved the .CSV file to the same folder where my .py is, for some reason VS Code doesn't see the file and tells me it doesn't exist. How do I fix it? Maybe I need to install a plugin for it? I just don't know how VS Code works at all xd