← Back to NumPy Course | Chapter 1: Getting Started | Lesson 2 of 7

Installing NumPy

Installing NumPy means downloading the library once so every Python program on your computer can use it.

In this page:

  1. Installing NumPy

Installing NumPy

NumPy is installed with pip, Python's package manager. Using a virtual environment keeps the install isolated per project. After installing, you can check the version from the command line.

Note: Use python -m pip instead of bare pip to be sure you install into the same Python you run.

Example: Installing NumPy

bash
$ python -m venv venv
$ source venv/bin/activate        # Windows: venv\Scripts\activate
$ python -m pip install numpy
Successfully installed numpy-1.26.4

$ python -c "import numpy; print(numpy.__version__)"
1.26.4

⚠️ Run this in your own terminal or Node.js environment.

Related Topics
Common Mistakes
  1. Installing into the wrong Python interpreter
  2. Skipping a virtual environment and polluting the system Python
  3. Naming a script numpy.py, which shadows the real library
Chapter Summary
  • Install with pip install numpy
  • Use a virtual environment per project
  • Verify with numpy.__version__
  • Conda users can run conda install numpy
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.