当前位置:网站首页>NumPy学习挑战第一关-NumPy的下载与安装
NumPy学习挑战第一关-NumPy的下载与安装
2022-06-26 06:44:00 【云曦我女神】
NumPy 安装
Python 官网上的发行版是不包含 NumPy 模块的。
我们可以使用以下几种方法来安装。
1、使用已有的发行版本
对于许多用户,尤其是在 Windows 上,最简单的方法是下载以下的 Python 发行版,它们包含了所有的关键包(NumPy,SciPy,matplotlib,IPython,SymPy 以及 Python 核心自带的其它包):
- Anaconda: 免费 Python 发行版,用于进行大规模数据处理、预测分析,和科学计算,致力于简化包的管理和部署。支持 Linux, Windows 和 Mac 系统。
- Enthought Canopy: 提供了免费和商业发行版。持 Linux, Windows 和 Mac 系统。
- Python(x,y): 免费的 Python 发行版,包含了完整的 Python 语言开发包 及 Spyder IDE。支持 Windows,仅限 Python 2 版本。
WinPython: 另一个免费的 Python 发行版,包含科学计算包与 Spyder IDE。支持 Windows。 - Pyzo: 基于 Anaconda 的免费发行版本及 IEP 的交互开发环境,超轻量级。 支持 Linux, Windows 和 Mac 系统。
2、使用 pip 安装
安装 NumPy 最简单的方法就是使用 pip 工具:
pip3 install --user numpy scipy matplotlib
–user 选项可以设置只安装在当前的用户下,而不是写入到系统目录。
默认情况使用国外线路,国外太慢,我们使用清华的镜像就可以:
pip3 install numpy scipy matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
Linux 下安装
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 系统
Mac 系统的 Homebrew 不包含 NumPy 或其他一些科学计算包,所以可以使用以下方式来安装:
pip3 install numpy scipy matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
安装验证
测试是否安装成功:
>>>from numpy import *
>>>eye(4)
array([[1., 0., 0., 0.],
[0., 1., 0., 0.],
[0., 0., 1., 0.],
[0., 0., 0., 1.]])
#from numpy import * 为导入 numpy 库。
#eye(4) 生成对角矩阵。
因为我准备学习Python数据分析(为数学建模做准备),所以我选择了Anaconda这个免费的Python发行版,如果你也想下载安装,可以到清华镜像源下载,然后找相关安装教程,一步一步跟着教程安装即可。
边栏推荐
- Bugku exercise ---misc--- prosperity, strength and democracy
- Get the first and last days of the current month, and the first and last days of the previous month
- Research Report on market supply and demand and strategy of China's microneedle device industry
- LabVIEW arduino TCP / IP Remote Intelligent Home System (Project section - 5)
- Closure problem C Lua
- Decision tree learning notes
- 【golang】time相关
- The four cores of the browser: Trident, gecko, WebKit, blink
- Hudi compilation of data Lake architecture
- 直播预告丨消防安全讲师培训“云课堂”即将开讲!
猜你喜欢

“试用期避免被辞退“ 指南攻略

Decompile Android applications, interview Android

闭包问题C# Lua

Marketing skills: compared with the advantages of the product, it is more effective to show the use effect to customers

【golang】time相关

Bugku exercise ---misc--- prosperity, strength and democracy

Reasons why MySQL indexes are not effective

面试官:测试计划和测试方案有什么区别?

MYSQL(三)

Vulnerability discovery - API interface service vulnerability probe type utilization and repair
随机推荐
闭包问题C# Lua
3.pyinstaller module introduction
MySQL 数据库的小白安装与登录
[golang] time related
SecureCRT运行SparkShell 删除键出现乱码的解法
Web technology sharing | webrtc recording video stream
Typescript type
New generation engineers teach you how to play with alluxio + ml (Part 1)
js-下载图片
如何把数据库的数据传给复选框
cocoscreator播放Spine动画
Reasons why MySQL indexes are not effective
I have been testing at Tencent for several years
Closure problem C Lua
Analyse d'un problème classique
SHOW语句用法补充
Market trend report, technical innovation and market forecast of China's valeryl chloride
直播预告丨消防安全讲师培训“云课堂”即将开讲!
Requirement analysis of personal blog system
SQL Basics