Installing NumPy
Installing NumPy means downloading the library once so every Python program on your computer can use it.
In this page:
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
$ 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
- Installing into the wrong Python interpreter
- Skipping a virtual environment and polluting the system Python
- 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: