VS Code · for data scientists
VS Code for data scientists on Mac: setup, notebooks, and shortcuts in 2026
VS Code for data scientists on Mac means using Microsoft's editor for Jupyter notebooks, Python environments, and data exploration. Set up a Python environment with Jupyter, open a .ipynb file, pick the kernel, and you can load, plot, and model data in one window. This guide covers the setup, the features that matter, the mistakes to avoid, and where Lazur fits.
You say“Walk me through picking the kernel for this notebook.”
Lazur · walks you through itLazur guides you one click at a time and waits for each click, so you keep control of the notebook.
Quick answer
- Set up a Python environment with Jupyter installed, then pick it as the notebook kernel.
- Use the Variables pane and Data Viewer to check DataFrames before you model anything.
- Restricted Mode blocks cell execution, so trust your own workspace before you run code.
- Debug Cell and Run by Line need ipykernel 6 or newer, and they ignore launch.json.
- Lazur points at things, guides you one click at a time, and answers out loud. It does not click for you.
45%
Share of their time respondents say data scientists spend getting data ready, in Anaconda's 2020 survey
2020 State of Data Science (Anaconda)75.9%
Of 2025 Stack Overflow IDE respondents use Visual Studio Code. This covers all developers, not only data scientists.
Stack Overflow Developer Survey 2025: TechnologyWhat data scientists ask Lazur in VS Code
Hold ⌥ ⌘ in VS Code and say it.
“What does this pandas error mean?”
Lazur reads the error on screen and explains it out loud in plain words.
Explains what's on screen · VS Code
“Where is the Variables pane?”
Lazur draws a circle and a label around the Variables pane on your screen.
Points at it · VS Code
“Walk me through picking the kernel for this notebook.”
Lazur guides you one click at a time and waits for each click before the next step.
Walks you through it · VS Code
“Dictate a note: the churn model drops rows with nulls in tenure.”
Hold fn and speak. The clean text lands at your cursor in the notebook or any other app.
Types what you say · VS Code
“Draft a markdown cell that explains the train and test split.”
Lazur types a short markdown explanation you can paste into a notebook cell and edit.
Drafts it · VS Code
“Research the scikit-learn release notes from this year.”
The research runs in Lazur's Chrome tabs and comes back with a summary and a report.
Researches in the background · VS Code
“Set a timer while this cell trains.”
Lazur starts the timer by voice, so you can keep your hands on the notebook.
Handles the small stuff · VS Code
How VS Code fits data science work on Mac
Most of the data work in VS Code happens in Jupyter notebooks. A notebook is a .ipynb file split into cells. Each cell holds code or text. You run one cell at a time and read the output right below it. That loop is why notebooks suit exploration. Microsoft's data science guide says you can start analyzing and visualizing data in minutes this way.
The editor itself is widely used. In Stack Overflow's 2025 Developer Survey, 75.9% of IDE respondents use Visual Studio Code. Among professional developers, the share is 76.2%. Those figures cover all developers, not only data scientists. Read them as a sign of how much support the editor has, not as a data science ranking.
45%
Share of their time respondents say data scientists spend getting data ready, in Anaconda's 2020 survey
2020 State of Data Science (Anaconda)75.9%
Of 2025 Stack Overflow IDE respondents use Visual Studio Code. This covers all developers, not only data scientists.
Stack Overflow Developer Survey 2025: Technology
Microsoft's overview also mentions the Interactive Window. It links to a separate page, but the overview does not explain what the window does. Treat the Interactive Window as something to test on a small file before you build a workflow around it. This guide follows the notebook path.
Set up a Python environment for VS Code on Mac
Notebooks do not run until VS Code can see a Python environment with Jupyter installed. Microsoft's notebook guide says to activate an Anaconda environment, or another Python environment with the Jupyter package. The official data science tutorial creates a conda environment named myenv with Python 3.10. It installs pandas, jupyter, seaborn, and scikit-learn. It also installs Keras and TensorFlow for an optional neural network.
The tutorial has a gap for Mac users. It does not include macOS Python install steps. It names Windows and Linux shortcuts next to Mac symbols such as ⇧⌘P and ⌃`. That means you choose and install Python yourself. Pick one install, note where it lives, and use it for every project. VS Code 1.145 offers Universal, Intel, and Apple silicon downloads. On Apple silicon, use the Apple silicon or Universal download.
- Install a Python distribution you trust. Anaconda works, and so does any setup with Jupyter available.
- Create a named environment. The tutorial uses myenv with Python 3.10.
- Install pandas, jupyter, seaborn, and scikit-learn into that environment.
- Open your project folder with File > Open Folder. One project per folder keeps things clear.
- Create a file named analysis.ipynb, then select your environment as the kernel.
Check ipykernel before you blame VS Code
Run by Line and Debug Cell both need ipykernel 6 or newer. Open the terminal with ⌃` and run pip show ipykernel while your environment is active. If the version is below 6, upgrade it inside that same environment. A common mistake is upgrading the base Python while the notebook uses myenv. Check the environment name first.
Trust the workspace so cells run
Restricted Mode is a VS Code safety setting. In Restricted Mode, you cannot execute notebook cells, and rich outputs such as plots stay hidden. Microsoft's docs tell you to work in a trusted workspace. If a cell does nothing and the plot is missing, look for the trust prompt before you change any code.
After you trust the folder, run one cell that prints something simple. If the output appears, the kernel and the workspace both work. Then start the real analysis.
Inspect DataFrames with the Variables pane and Data Viewer
The Variables pane shows the variables in your notebook session. You can see a DataFrame's name and type without writing a print statement. Data Viewer opens a DataFrame as a table. Each column has its own filter, so you can narrow rows quickly while you check the data.
The filter has one trick. Type an equals sign before a value to match it exactly, like =female. Use a regular expression for pattern matches. Exact matches are safer when a column has near duplicates, such as male and Male.
Here is a worked example. Load titanic3.csv, the dataset the tutorial uses, into a DataFrame. Open it in Data Viewer. Filter the sex column with =female to count the rows. Then filter the age column and check whether any values look wrong. Count the rows before you trust any summary you compute.
Large tables can slow the editor. Microsoft's notebook guide does not mention performance or known issues, so the docs will not warn you. While you explore, sample the data with df.sample or df.head. Load the full file once you know which columns matter.

Train a model in one notebook: a worked example
The tutorial works on the Titanic passenger dataset. Its Naive Bayes model reaches about 75% accuracy. The optional Keras network reaches about 79%. Those are tutorial results on one split. They are a starting point for your own comparison, not a benchmark to quote.
A four point gap on one split is weak evidence. Split the data again with a different random seed and compare the two models. If the ranking flips, the first gap was noise. Write the seed into the notebook so the run repeats the same way on your Mac next week.
Keep each step in its own cell. Load, clean, engineer features, train, and score each get a cell of their own. When a score changes, you can rerun only the cell that changed. That habit saves time when a model needs several passes.
Debug a cell with Debug Cell and Run by Line
A print statement works for a quick check. For a bug inside a function, use Run by Line or Debug Cell. Both need ipykernel 6 or newer. Debug Cell runs the cell in VS Code's full debugger. It does not read debug configurations from launch.json. People who wrote a launch file for scripts often expect it to apply, and it does not.
Use Run by Line when you want to move through a cell one statement at a time. Use Debug Cell when the bug depends on a breakpoint inside a function call or a loop. Set the breakpoint in the left margin of the cell, then start the debug run.
Shortcuts and settings to learn first in VS Code on Mac
- ⇧⌘P opens the Command Palette. Type a command name, such as Python: Select Interpreter, and press return.
- ⌃` opens the integrated terminal. Use it for pip and conda commands inside your active environment.
- ⌘, opens Settings. Search for notebook to see options that change how cells run and display.
- Data Science profile template: Microsoft lists it as a next step. It is a profile with curated extensions, settings, and snippets.
- Data Wrangler is another option. Microsoft mentions it as an alternative. Read its own docs before you rely on its features.
Learn two shortcuts first, ⇧⌘P and ⌃`. They cover most of the setup work in this guide. The rest can wait until a task needs them.
Keep notebooks reproducible on your Mac
A notebook that runs once is not enough. Another person, or you in a month, needs the same result. Start by pinning the environment. Run pip freeze inside myenv and save the output to a requirements file in the project folder.
Then keep the data path in one cell at the top. Use a relative path inside the project folder. Absolute paths like a Downloads folder break the moment you move the project to another Mac.
Run All before you share the notebook. Restart the kernel first, then check the output again. If the output changes, a hidden cell or a stale variable caused it. Fix the order of the cells, not the output.
Where VS Code for data scientists on Mac gets awkward
| Problem | What Microsoft's docs say | What to do |
|---|---|---|
| Cells will not run | Restricted Mode blocks cell execution | Trust the workspace, then run one cell |
| Web version feels thin | VS Code for the Web has no terminal and limited debugging | Use the desktop app for real analysis |
| PDF export fails | PDF export needs TeX installed | Export to HTML, then print to PDF from the browser |
| Interactive Window is unclear | The overview links to it without explaining it | Test it on a small file first |
| Large data feels slow | The notebook guide does not mention performance | Sample the data while you explore |
| Setup is confusing | The tutorial assumes conda or Anaconda knowledge | Follow the environment steps in this guide |
These limits are not reasons to avoid VS Code. They are reasons to test your setup on a small project before a deadline. Find the limit on day one, not during a client demo.
Export a notebook to PDF for a colleague
PDF export of notebooks requires TeX. Without TeX, the export fails. Microsoft's documented workaround is to export the notebook to HTML, open that HTML file in your browser, and print it to PDF. In Safari or Chrome on Mac, the print dialog opens with ⌘P.
SVG-only plots do not show in the PDF. If a chart is missing from the export, check its output type. Saving the plot as an image before export is a simple fix.
Where Lazur fits in your VS Code workflow
Lazur is a voice assistant for the Mac. It lives in the notch. Hold ⌥⌘ to ask about anything on screen, and Lazur answers out loud. It listens and looks at your screen only while you hold the shortcut.
Ask where something is, and Lazur draws a circle and a label around it. Ask how to do something, and Lazur guides you one click at a time. It waits for each click. It does not click for you, edit your files, or operate other apps.
Hold fn to dictate clean text at the cursor in any app. That helps when you write markdown cells, comments, or a commit message. Snippets, a personal dictionary, and clipboard slots help with repeated names and paths.

Questions to ask Lazur while a notebook is open
These requests fit a notebook session. Say them out loud while the notebook is in front of you.
- What does this pandas error mean? Lazur explains it out loud, using what is on your screen.
- Where is the Variables pane? Lazur draws a circle and a label around it.
- Walk me through picking the kernel. Lazur guides you one click at a time.
- Dictate a note: the churn model drops rows with nulls in tenure. Hold fn and speak.
- Draft a markdown cell that explains the train and test split.
- Research the scikit-learn release notes. The research runs in Lazur's Chrome tabs, with the Lazur for Chrome extension, and comes back with a summary and report.
- Set a timer while this cell trains.
Each request maps to a different capability. Explain and point cover questions about the screen. Guide covers steps. Dictate and draft cover text you write. Research and everyday cover work outside the notebook.
Mistakes that waste the most time
- Installing packages into the wrong environment. Check the kernel name before you run pip install.
- Skipping the trust prompt, then blaming the code for cells that never ran.
- Loading a huge CSV in full just to see the columns. Sample first, then load the full file once.
- Writing a launch.json for a notebook bug. Debug Cell does not read it.
- Comparing two models on one split. Repeat the split with a new seed before you pick a winner.
- Expecting VS Code for the Web to behave like the desktop app. It has no terminal.
- Exporting to PDF without TeX installed. Use the HTML route instead.
What to do next
Start with one notebook on the Titanic data from the tutorial. The expected results are published, so you can check your setup against them. Then build your own project in its own folder with its own environment.
If you also write code outside notebooks, read VS Code for developers on Mac. It covers setup, shortcuts, debugging, and Git. For the AI side of the editor, see the VS Code assistant page.
To try Lazur on your Mac, go to download. Plans and trial details are on pricing. The trial needs no credit card.
Questions people ask
Does VS Code for data scientists on Mac need Anaconda?
No. Microsoft's notebook guide says you need an activated Anaconda environment or another Python environment with the Jupyter package installed. Anaconda is one option. Pick one Python install and use it for every project.
Why won't my notebook cells run in VS Code?
Check Restricted Mode first. In Restricted Mode, cells cannot run and rich outputs such as plots stay hidden. Trust the workspace, then run one simple cell to test it.
What is the difference between the Variables pane and Data Viewer?
The Variables pane shows the variables in your notebook session. Data Viewer opens a DataFrame as a table, with a filter for each column. Use the pane to find a name and the viewer to scan rows.
Does Lazur work inside VS Code?
Lazur works across apps on your Mac, including VS Code. It is not a plugin or add-in for VS Code. It listens and looks at your screen only while you hold the shortcut, and it does not click or edit files for you.
Can Debug Cell use my launch.json file?
No. Debug Cell runs in the full VS Code debugger and does not use debug configurations in launch.json. Debug Cell and Run by Line both need ipykernel 6 or newer.
Why does PDF export fail in VS Code?
PDF export of notebooks requires TeX. Without it, the export fails. Export to HTML, open the file in a browser, and print to PDF. SVG-only plots do not show in the PDF output.
Is VS Code for the Web good enough for data science?
It runs entirely in the browser. It has no terminal access, limited debugging, and partial Python IntelliSense. Use the desktop app for serious analysis on your Mac.
Does Lazur run on Windows?
Not yet. Lazur is for macOS on Apple silicon and Intel Macs. Windows is planned, not available.
Sources
- Jupyter Notebooks in VS Code · Microsoft · checked 2026-11-08
- Data Science in VS Code tutorial · Microsoft · checked 2026-11-08
- Jupyter Notebooks on the web · Microsoft · checked 2026-11-08
- Data Science in Visual Studio Code · Microsoft · checked 2026-11-08
- Visual Studio Code 1.145 · Microsoft · checked 2026-11-08
- 2020 State of Data Science · Anaconda · checked 2026-11-08
- Stack Overflow Developer Survey 2025: Technology · Stack Overflow · checked 2026-11-08
Try Lazur free for 3 days
Hold a key and ask. Lazur sees your screen, points at the button and talks you through it, in any Mac app. No credit card.