安装Python Numpy(Linux、Windows、MacOSX)

NumPy是一个流行的第三方Python库,用于数值运算。作为第三方模块,Python默认不提供它。对于不同的操作系统(Windows、Linux、MacOSX),NumPy可以以不同的方式安装(pip、package manager、installer)。

null

安装NumPy For Linux和MacOSX

对于Linux发行版,可以使用package manager、pip命令安装NumPy。

使用pip命令安装NumPy(Ubuntu、Debian、Mint、Fedora、CentOS、RHEL)

pip是Python官方包安装程序,可以安装所有流行的Python包。pip命令可用于安装NumPy。

pip install numpy

在某些情况下,Python3使用pip3命令来管理Python包。

pip3 install numpy

使用apt软件包管理器安装NumPy(Ubuntu、Debian、Mint)

像Ubuntu、Debian、Mint等Linux发行版使用apt或apt-get包管理器来安装包。可以使用apt或apt-get包管理器安装NumPy。

sudo apt install python3-numpy
图片[1]-安装Python Numpy(Linux、Windows、MacOSX)-yiteyi-C++库
使用apt软件包管理器安装NumPy(Ubuntu、Debian、Mint)

使用dnf软件包管理器安装NumPy(Fedora、CentOS、RHEL)

Linux发行版如Fedora、CentOS、RHEL使用dnf或yum命令进行包管理。NumPy命令可以与yum或dnf包管理器一起安装,如下所示。

sudo dnf install python3-numpy

安装NumPy For Windows

NumPy也可以安装在Windows XP、Windows 8、Windows 10或Windows Server等Windows操作系统上。pip包管理器可用于在Windows中安装NumPy。pip或pip3命令可用于安装NumPy。

pip3 install numpy
pip install numpy
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享