Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
For a reliable Python and pandas setup, install Python, create a project virtual environment, and install packages with that environment’s Python: python -m pip install pandas. The key to avoiding the “pip install worked, but Python can’t import it” problem is using the same interpreter to install and run your code.
Choose an installation route
There are two practical ways to get started. Use standard Python with a virtual environment for a lightweight setup focused on a project. Choose conda if you want an environment manager that can provide Python along with a broader scientific-computing stack. Neither route is universally best; follow course or team requirements if they specify one.
| Route | What it gives you | Good fit when |
|---|---|---|
| Python with pip and a virtual environment | Standard Python tooling and a separate package location for each project. You select and maintain the Python environment yourself. | You want a straightforward project setup and are comfortable selecting the interpreter you use. |
| Conda or Anaconda | Conda can manage Python and packages in an environment. Anaconda bundles a data-science stack; pandas describes it as a simple option for newcomers who want packages such as pandas, NumPy, SciPy, and Matplotlib together. | You need multiple scientific packages or a course or team already uses conda. pandas notes that the pandas build distributed through Anaconda is not managed by the pandas development team. |
The pandas installation guide documents both pip from PyPI and conda-forge. NumPy also describes Anaconda as a simple bundled starting point and explains that conda can install Python while pip installs packages for a particular Python: NumPy installation guide.
Install Python and pandas with pip
Use the Python command appropriate for your operating system, then create a virtual environment inside your project folder. A virtual environment keeps project packages separate from other Python projects and from the operating system’s Python.
#1 Best Overall
Windows
- Install Python using the Python Install Manager from python.org or the Microsoft Store, following the current Python for Windows guide. Windows does not include a system-supported Python installation by default.
- Open a new terminal and check the launcher with
py --version. If multiple Python versions are installed, select the version your project requires. - In the project folder, create an environment:
py -m venv .venv. - To activate it in PowerShell, run
.venvScriptsActivate.ps1. In Command Prompt, run.venvScriptsactivate.bat. You can skip activation and call the environment’s Python directly. - Install pandas while the environment is active with
python -m pip install pandas. Or use the environment’s interpreter explicitly:.venvScriptspython.exe -m pip install pandas.
macOS and Linux
- Use an appropriate Python distribution for your operating system. On Linux, the distribution may manage a system Python; avoid changing its global packages with pip.
- In the project folder, create an environment with
python3 -m venv .venv. - Activate it with
source .venv/bin/activate, or skip activation and use.venv/bin/pythondirectly. - Install pandas with
python -m pip install pandaswhile the environment is active, or run.venv/bin/python -m pip install pandas.
The Python virtual-environment guide covers creation and activation. Activation changes which Python and pip commands your shell finds; using the environment’s full Python path makes the selected interpreter explicit.
Check that the installation works
Run the check with the same Python you used to install pandas. If you activated the environment, use:
Rank #2
python -c "import pandas as pd; print(pd.__version__)"
If you skipped activation, replace python with the environment’s interpreter path: .venvScriptspython.exe on Windows or .venv/bin/python on macOS and Linux. A version number means that interpreter can import pandas.
Why pip install may not work for the Python running your code
pip installed into a different Python
A computer can have several Python installations, each with its own packages. A plain pip install pandas may point to a different installation than the python command running your script. Bind pip to the interpreter by running python -m pip install pandas; for a versioned interpreter, use the matching command, such as python3.14 -m pip install pandas on POSIX or py -3.14 -m pip install pandas on Windows. The version numbers are examples: choose a version installed on your machine and required by your project. The Python guide to installing packages documents these interpreter-specific forms.
For a script, use the same interpreter to install and run it. For a notebook, select the environment that contains pandas as the notebook’s Python kernel. If the notebook is attached to a different environment, its imports will not see packages installed elsewhere.
The environment is externally managed
On some Linux distributions, pip refuses to change packages in the base Python because the operating system manages them. The marker is called EXTERNALLY-MANAGED. PEP 668 explains that distributors using a non-Python package manager for Python libraries should generally ship this marker. For project packages, create a virtual environment and install there rather than overriding the protection. See PEP 668.
Rank #4
pip is missing
Run pip’s supported bootstrap command with the Python you intend to use: python -m ensurepip --upgrade. On Windows, you can use py -m ensurepip --upgrade. Some redistributors remove ensurepip, so the command may not be available in every Python distribution. The pip installation guide documents this method.
The error concerns a package or version, not the interpreter
An interpreter match does not resolve every installation error. If installation fails with a build, wheel, or compatibility message, check the complete error output alongside the Python version, operating system, hardware architecture, and requested package version. pandas publishes installation guidance and a supported-Python policy, but there is no single fix for all build, network, and version errors: consult the pandas installation guide for the specific case.
Best Value
Use conda for a bundled data-science environment
If you prefer conda, the pandas guide documents creating an environment with pandas from conda-forge:
conda create -c conda-forge -n analysis python pandas
Then activate the environment using the conda activation command for your platform. Use its Python when running code so that imports come from the environment you created. Conda and pip are different package-management tools; avoid mixing them casually in one environment, and follow your project or course’s package-management instructions.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Free tools Windows power users keep installed
One-click scans. No signup required.

