在windows系统为Python安装matplotlib

本文详细介绍在Windows系统中为Python环境安装matplotlib的过程。步骤包括安装VisualStudio、选择匹配的matplotlib wheel文件、使用pip进行安装及测试matplotlib是否成功加载。通过绘制曲线图验证安装效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在windows系统为Python安装matplotlib

# 1. 首先安装Visual Studio
访问:dev.windows.com
点击download
查找Visual studio community
下载安装
#2. 访问pypi.python.org/pypi/matpltlib
查找使用python版本匹配的wheel文件(扩展名为.whl的文件)
例如32位python,需要下载matplotlib-1.4.3-cp35-none-win32.whl
#3. 将.whl文件复制到项目文件夹,打开命令窗口,切换到项目文件夹,使用pip安装
cd python_work
python_work> python –m pip install –user matplotlib-1.4.3-cp35-none-win32.whl
#4. 测试matplotlib
$python3

import matplotlib

观察是否报错
附另一个画图测试:画出曲线
import matplotlib.pyplot as plt
squares = [1,4,5,6,25]
plt.plot(squares)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值