English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
NumPy Installation Guide
For many users, especially on Windows, the simplest method is to download the following Python distributions, which include all the key packages (including NumPy, SciPy, matplotlib, IPython, SymPy, and other packages built into Python core):
Anaconda: A free Python distribution designed for large-scale data processing, predictive analysis, and scientific computing, committed to simplifying package management and deployment. Supported on Linux, Windows, and Mac systems.Enthought Canopy: It provides free and commercial distributions. Supported on Linux, Windows, and Mac systems.Python(x,y): A free Python distribution that includes the complete Python language development package and the Spyder IDE. Supports Windows, limited to Python only. 2 version.WinPython: Another free Python distribution that includes scientific computing packages and Spyder IDE. Supports Windows.Pyzo: Free distribution version based on Anaconda and the interactive development environment IEP, ultra-lightweight. Supports Linux, Windows, and Mac systems.
pip is a Python package management tool that provides functions for searching, downloading, installing, and uninstalling Python packages.
Currently if you are https://www.python.org If you download the latest version of the installation package, it is already equipped with this tool.
Python 2.7.9 + or Python 3.4+ All the above versions come with the pip tool.
Official website of pip:https://pypi.org/project/pip
You can use the following command to determine whether it is installed:
Before installing using pip, you need to check if pip is already installed, the specific command is as follows:
pip --version # Python2.x version command pip3 --version # Python3.x version command
If you have not installed it yet, you can use the following method to install:
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py # Download the installation script $ sudo python get-pip.py # Run the installation script
$ sudo python3 get-pip.py # Run the installation script
Generally, pip corresponds to Python 2.7,pip3 Corresponding to Python 3.x.
If pip has been installed, you can use the following command to install:
pip3 install --user numpy scipy matplotlib
--The 'user' option can be used to install only in the current user, rather than writing to the system directory.
By default, use the overseas route, but it is too slow overseas. We can use Tsinghua's mirror instead:
If you use conda, you can use the following command to install:
pip3 install numpy scipy matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
conda is divided into anaconda and miniconda. Anaconda is a version that includes some commonly used packages, while miniconda is a streamlined version that you can install whatever you need, so it is recommended to use miniconda.
Official website of miniconda:https://conda.io/miniconda.html Download and install the version that suits you.
The specific command for installing numpy with conda is as follows:
conda install numpy
Ubuntu & Debian
sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose
CentOS/Fedora
sudo dnf install numpy scipy python-matplotlib ipython python-pandas sympy python-nose atlas-devel
Mac System
pip3 install numpy scipy matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
To test whether the Numpy installation is successful, the specific code is as follows:
>>> import numpy as np >>> print(np.__version__) 1.19.1 >>> arr = np.array([1, 2, 3, 4, 5) >>> print(arr) [1 2 3 4 5]