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

被折叠的 条评论
为什么被折叠?



