VS Code

How to Install Pandas in VS Code (pip, venv and Conda)

How to Install Pandas in VS Code (pip, venv and Conda)

The install is a single command, python -m pip install pandas, run in the integrated terminal with the right environment active.

pandas goes into a Python interpreter, not into VS Code. So the install only helps if the interpreter selected in the editor is the one that received it.

That holds for plain scripts and notebooks, and it holds inside a virtual environment too.

As of October 2026, the VS Code Python settings reference lists venv as the default environment manager and pip as the default package manager. A project-level .venv with pip is the setup the editor expects.

What Does Installing pandas in VS Code Actually Mean?

YouTube player

VS Code never stores pandas itself. The editor sits on top of an interpreter, and the library lives inside that interpreter’s environment. Installing it just means adding pandas to whichever Python VS Code runs, so scripts and notebooks in that workspace can import it.

pandas comes from PyPI (installed with pip) and from conda-forge (installed with conda), the two package-manager routes in the pandas installation documentation. The same page also mentions GitHub for installing from source. The Extensions marketplace isn’t on the list.

VS Code picks the interpreter and decides which environment a new terminal activates, and Pylance checks imports against the packages installed there. The packages themselves belong to the interpreter’s environment. Nothing else counts.

That split explains the most common failure. pip can put pandas into one Python while the editor runs a different one, and the import breaks even though the install worked.

The usual diagnosis for the resulting ImportError never changes: pandas isn’t installed in the Python installation currently in use.

What Do You Need Before Installing pandas in VS Code?

Very little, for a terminal install.

  • Python 3. Run python --version to check, or py list on Windows to see every installed version (py -0 still works).
  • VS Code, any current release, with a project folder opened.
  • The Python extension from Microsoft, installed from the Extensions view. It adds the interpreter picker and terminal activation.
  • pip. Check with pip --version, though Python’s venv module installs pip into every new environment by default anyway.

Open a folder before creating anything. The Python Environments extension scans the workspace for .venv folders by default, so an environment created inside the project gets found without extra settings.

pandas also drops older Python releases over time. The Python version support section of the pandas installation page points to the pandas Python support policy, so check it against the interpreter you plan to use.

Command names differ by system, and the wrong one is a quiet source of confusion.

SystemPython commandpip command
Windowspy or pythonpy -m pip
macOSpython3python3 -m pip
Linuxpython3python3 -m pip

The behavior is identical across the three. This guide writes python in its commands, so swap in your platform’s name.

How to Create and Select a Python Environment in VS Code

YouTube player

The short version is to make a .venv folder inside the project, select it with Python: Select Interpreter, and open a new integrated terminal so VS Code activates it.

Every shortcut and workflow trick from this guide - including Ctrl+P for quick open, Ctrl+Shift+P for the command palette, and the full grid of keyboard shortcuts - is on one page in the VS Code Workflow Cheat Sheet.

  1. Open the project folder in VS Code, then open the integrated terminal from the Terminal menu.
  2. Run python -m venv .venv in the project root (python3 -m venv .venv on macOS and Linux, py -3 -m venv .venv on Windows).
  3. Press Ctrl+Shift+P (Cmd+Shift+P on macOS) to open the Command Palette and run Python: Select Interpreter.
  4. Pick the entry whose path ends in .venv.
  5. Open a new terminal and confirm the prompt starts with (.venv).

A project venv beats the global interpreter for pandas work, and I’d use one every time. Python’s venv documentation describes each environment as holding its own independent set of installed packages, so a pandas upgrade in one project never touches another.

Deleting a single folder removes a venv and everything in it. The global interpreter is the opposite: one package set shared by every project on the machine.

Creating a venv

The venv module ships with Python, so there’s nothing to install. The environment inherits the Python version of the interpreter that created it.

Run the command from step 2 in the terminal, or skip the terminal and use the Python sidebar (Environment Managers, then the + button).

As of October 2026, VS Code’s documentation lists only venv and conda as environment types it can create from the editor. Conda environments show up in the picker only when they contain an interpreter.

▶ VS CODE PRODUCTIVITY

If you spend a lot of time in VS Code, chances are you are doing some things the slow way. These 10 built-in features eliminate repetitive clicking, scrolling, and retyping - no extensions required.

VS Code Tips That Save You Hours

If uv is installed, the Python Environments extension uses it by default for venv creation and for package installs made from the editor’s interface (the python-envs.alwaysUseUv setting is true by default). Installs you run yourself in the terminal still use whichever tool you type.

Selecting the interpreter

Find the picker through the Command Palette, or click the Python version shown in the Status Bar. The list labels each entry by type (Global, Conda, Workspace).

One gotcha. Changing the interpreter does not affect terminals that are already open, so open a fresh terminal after every switch.

If the venv doesn’t appear in the list, choose Enter interpreter path and point at .venv/bin/python (macOS and Linux) or .venv\Scripts\python.exe (Windows).

Once an interpreter is selected, new terminals activate it automatically. The python.terminal.activateEnvironment setting defaults to true, and the newer python-envs.terminal.autoActivationType setting (default: command) takes precedence when it is configured.

Fixing the activation script blocked by PowerShell execution policy

On Windows, activation runs Activate.ps1. When the execution policy blocks scripts, the terminal reports that running scripts is disabled and the (.venv) prefix never appears.

Any of these gets you past it.

  • Allow local scripts for your account only with Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, the form shown in Python’s venv documentation
  • Switch the terminal profile to Command Prompt, which uses activate.bat
  • Skip activation entirely and call .venv\Scripts\python.exe -m pip install pandas directly

The last one works because activation only prepends the environment’s folder to PATH. Python’s documentation says scripts inside a venv run with its own interpreter whether or not it is activated.

How to Install pandas With pip in the Integrated Terminal

YouTube player

With the environment active, run python -m pip install pandas in the integrated terminal. The python -m prefix ties pip to the interpreter on your PATH, so the package lands in the selected environment instead of whichever pip answers first.

A bare pip resolves through PATH and can belong to a different Python than python does. Comparing pip --version, which prints the Python it belongs to, with python --version exposes a mismatch in seconds.

On Windows the command is py -m pip install pandas. On macOS and Linux it’s python3 -m pip install pandas.

pip downloads pandas from PyPI together with its required dependencies, which are NumPy and python-dateutil, plus tzdata on Windows (pandas documentation). The output ends with a Successfully installed line naming every package it added.

A terminal opened before the interpreter was selected is not activated. Check for the (.venv) prefix before running the install, because pip writes to the global interpreter otherwise. It’s an easy thing to skip when you’re in a hurry.

The place this fails is a system Python on Debian-based Linux or Homebrew.

pip stops with error: externally-managed-environment. PEP 668 lets distributions tell pip to refuse installs outside a virtual environment, and on those systems even pip install --user is blocked.

The fix is the .venv from the previous section. The --break-system-packages flag overrides the block, but on a desktop or server install it risks breaking operating system tools that depend on those packages.

pip, conda or uv: Which Method Fits Your Setup?

YouTube player

Use whatever installer built the environment. That means pip for a venv and conda for a conda environment, with uv as an option for a venv when install speed matters. Mixing tools inside one environment is where the trouble starts.

MethodCommandFitsLimitation
pippython -m pip install pandasvenv projects, the default pathSlower installs than uv
condaconda install -c conda-forge pandasAnaconda and Miniconda environmentsLater pip installs can break the environment
uvuv pip install pandasvenv projects that want speedExtra tool to install, not an exact pip clone

To pick, check the type label beside the interpreter in the picker. Conda entries get conda install, and everything else gets pip or uv.

conda can build the environment and install pandas in one step with conda create -c conda-forge -n name_of_my_env python pandas, a form shown in the pandas installation documentation.

Anaconda’s guidance on combining the two tools is blunt. Run pip only after the conda installs, and rebuild the environment instead of running conda again afterward, because conda does not track what pip changed.

Unlike pip, uv refuses to work outside a virtual environment by default. Run uv venv to create .venv, then uv pip install pandas, and uv finds that .venv on its own.

uv itself installs through Astral’s standalone installer or with pip install uv.

Astral’s README claims a 10 to 100 times speedup for the uv pip interface over pip.

For a single library like pandas the saving is small in absolute terms. It grows once a requirements file holds dozens of packages.

Astral’s documentation also warns that uv pip commands do not exactly replicate pip’s behavior, so edge cases differ.

How to Check That pandas Installed Correctly

YouTube player

Run python -m pip show pandas and read the Version and Location lines. pip’s documentation lists Name, Version, Location and Requires in that output, and a Location path inside your .venv folder confirms the package went to the right place.

python -m pip list prints every package in the active environment, so pandas and NumPy should both appear.

That only shows files exist on disk. To prove Python can load the library, run python -c "import pandas as pd; print(pd.version)".

When you’re not sure which interpreter answered, python -c "import sys; print(sys.executable)" prints its path. Compare it with the path in the Status Bar.

Then run the same import from a .py file with the Run Python File in Terminal command, which uses the selected interpreter.

Terminal passes, file fails? The terminal and the editor point at different interpreters.

Using pandas in a Jupyter Notebook Inside VS Code

YouTube player

A notebook needs the Jupyter and Python extensions, plus ipykernel inside whichever environment you pick as the kernel. According to the VS Code documentation, the jupyter package itself is not required.

Click Select Kernel at the top right of the notebook, or run the Notebook: Select Notebook Kernel command. Python environments are grouped by type (conda, venv), whether or not ipykernel is installed in them.

If ipykernel is missing, VS Code prompts to install it when you run a cell. The terminal route is python -m pip install ipykernel. The kernel you choose is tied to that notebook file and selected again the next time it opens.

Installing pandas from the terminal writes to whichever environment is active in that terminal, which is not always the kernel’s.

A cell install behaves differently. %pip install pandas runs pip through the current kernel, so the package lands where the notebook looks. IPython added the %pip and %conda magics in version 7.3.

IPython prints a note recommending a kernel restart after the install. Take it, then import pandas in a fresh cell.

A first cell with import sys; print(sys.executable) shows which environment the kernel runs, which settles most notebook import errors before they start.

Why pandas Is Not Found After Installing It in VS Code

Almost every case is an interpreter mismatch. pip wrote pandas into one environment, and the Run button or the notebook kernel is pointed at another.

SymptomLikely causeCheckFix
ModuleNotFoundError on runRun button uses an interpreter without pandassys.executable vs Status BarSelect the venv, rerun
pip is not recognizedScripts folder missing from PATHwhere pip (Windows)py -m pip install pandas
Yellow underline, code still runsPylance reads a different interpreterInterpreter in Status BarSelect Interpreter, reload window
Error only in a notebookKernel differs from the terminal environmentsys.executable in a cellPick the kernel, use %pip

ModuleNotFoundError after a successful install

The clearest sign is pip answering “Requirement already satisfied” with a path inside .venv while the run still fails. Stack Overflow questions show exactly that pattern: pip reports pandas as already installed in the venv’s site-packages, yet the script launched from the editor still raises ModuleNotFoundError.

Match the Location line from pip show pandas against the interpreter path in the Status Bar. If they differ, select the interpreter that owns the Location path.

Remote windows follow the same rule on a different machine. VS Code detects kernels and interpreters on the system it operates on (desktop, Codespaces, remote server, per its Jupyter documentation), so pandas has to be installed on that side.

pip is not recognized

On Windows, the Python documentation now recommends the Python install manager, which provides the python and py commands. A bare pip only works once the manager’s global commands folder is on PATH. The older full installer, deprecated since Python 3.14, adds the install and Scripts folders to PATH only when that option is selected. Without PATH, pip fails while py -m pip install pandas still works.

On macOS and Linux the command is usually python3 -m pip, because a bare pip is not installed on every system.

To fix PATH permanently on Windows, add the install manager’s global commands folder (%LocalAppData%\Python\bin by default) through “Edit environment variables for your account”, or run py install --refresh and add the global shortcuts directory it reports. With the older full installer, change the installation through Programs and Features and enable the PATH option. Open terminals keep the PATH they started with, so restart VS Code afterward.

Import could not be resolved warning from Pylance

The underline is an editor message, not a runtime error. Code can run fine while the warning stays.

It shows up worded two ways.

  • Import could not be resolved (reportMissingImports)
  • Import could not be resolved from source (reportMissingModuleSource)

Both clear the same way. Install pandas into the environment shown in the Status Bar, or select the environment that already has it.

If the underline survives, run Developer: Reload Window from the Command Palette. Pylance maintainers say it follows the interpreter chosen through the Python extension and cannot correct a wrong selection.

FAQ About Installing pandas in VS Code

Does Anaconda already include pandas?

Yes, the Anaconda distribution ships with pandas preinstalled. Select the Anaconda interpreter in VS Code and confirm with conda list pandas.

Miniconda doesn’t bundle it, so install pandas there with conda.

Can I install pandas without a virtual environment?

Yes, run python -m pip install pandas against the global interpreter. Every project then shares one package set.

Systems that mark Python as externally managed refuse the install, so a venv is the safer default.

How do I install a specific pandas version?

Pin the version in the command: python -m pip install pandas==3.0.6. Conda uses a single equals sign, as in conda install -c conda-forge pandas=3.0.6.

Check the result with python -m pip show pandas.

What is the command to upgrade pandas?

Run python -m pip install –upgrade pandas in the active environment. Print pd.version afterward to confirm the new release.

Restart any open notebook kernel, because a running kernel keeps the old version loaded.

How do I remove pandas from an environment?

Run python -m pip uninstall pandas, or conda uninstall pandas in a conda environment. Add -y to pip to skip the confirmation prompt.

Dependencies such as NumPy stay installed, so delete the .venv folder to clear everything.

Keeping pandas Versions Consistent Across Machines

Writing the environment’s exact versions to a requirements.txt file makes the install repeatable on another machine. Teammates rebuild the same environment from that file instead of repeating the install by hand.

  • Freeze after the import check passes
  • Commit requirements.txt, never the .venv folder
  • Rebuild with a fresh venv, then run python -m pip install -r requirements.txt

The order matters. python -m pip freeze > requirements.txt records whatever is installed at that moment, so a broken setup gets recorded too.

The folder stays out of version control because scripts inside a venv carry a shebang line pointing to the original interpreter’s absolute path, per the Python documentation. A copied .venv still points at the first machine.

The catch is that freeze pins every package, including NumPy and python-dateutil, so the file can fail to resolve on a different Python version or operating system.

Bogdan Sandu

Stay sharp. Ship better code.

Every week: one curated article, one tool worth knowing, one tip you can use tomorrow. No noise, no padding.