[{"data":1,"prerenderedAt":325},["ShallowReactive",2],{"content-query-e4jOZSmL7i":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"category":13,"body":14,"_type":319,"_id":320,"_source":321,"_file":322,"_stem":323,"_extension":324},"/technology-blogs/zh/1464","zh",false,"","【MindSpore易点通】让我们谈谈MindSpore安装这点事儿~","天空飘来五个字，那都不是事儿~","2022-05-05","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2022/05/05/fc2a0dccc47f492f9b4def2433567a95.png","technology-blogs","基础知识",{"type":15,"children":16,"toc":312},"root",[17,25,31,36,41,46,61,75,81,88,93,98,107,120,128,133,141,146,154,160,165,170,175,183,188,194,199,204,209,217,222,230,235,243,249,261,272,278,292,299,304],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"mindspore易点通让我们谈谈mindspore安装这点事儿",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29],{"type":24,"value":30},"引言：MindSpore易点通是易用性SIG打造的技术交流专区，致力于提升MindSpore易用性，帮助开发者打通使用MindSpore的“最后一公里”",{"type":18,"tag":26,"props":32,"children":33},{},[34],{"type":24,"value":35},"万事安装起，今天和大家来掰扯掰扯MindSpore安装这点事儿，当前MindSpore支持在Ascend（910和310）、GPU（CUDA 10.1和CUDA 11.1）、CPU硬件平台的Linux、Windows、MacOS操作系统上进行安装，也支持多种安装方式如Pip、Conda、Source等。",{"type":18,"tag":26,"props":37,"children":38},{},[39],{"type":24,"value":40},"**这里敲黑板！！！**随着1.7版本发布，我们在CPU-Linux、GPU、Ascend910和Ascend310环境上安装MindSpore都已支持自动安装啦！运行自动化脚本即可安装MindSpore，省时又省力！",{"type":18,"tag":26,"props":42,"children":43},{},[44],{"type":24,"value":45},"那么大家肯定会问，什么情况下优先选择自动安装？什么时候又需要进行手动安装呢？总结了一个明确的划分界限：",{"type":18,"tag":47,"props":48,"children":49},"ol",{},[50,56],{"type":18,"tag":51,"props":52,"children":53},"li",{},[54],{"type":24,"value":55},"如果是全新的操作系统上安装，我们推荐使用自动安装。",{"type":18,"tag":51,"props":57,"children":58},{},[59],{"type":24,"value":60},"如果是已经安装了部分依赖，如Python，GCC等，推荐手动安装。",{"type":18,"tag":26,"props":62,"children":63},{},[64,66],{"type":24,"value":65},"下面我们以CPU平台上Ubuntu18.04为例来说说不同安装方式的流程，可以先看视频：",{"type":18,"tag":67,"props":68,"children":72},"a",{"href":69,"rel":70},"https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/teaching_video/video/CPU-Ubuntu%E5%AE%89%E8%A3%85%E7%AF%87.mp4",[71],"nofollow",[73],{"type":24,"value":74},"https://mindspore-website.obs.cn-north-4.myhuaweicloud.com:443/teaching_video/video/CPU-Ubuntu%E5%AE%89%E8%A3%85%E7%AF%87.mp4",{"type":18,"tag":19,"props":76,"children":78},{"id":77},"_1-自动安装",[79],{"type":24,"value":80},"1 自动安装",{"type":18,"tag":82,"props":83,"children":85},"h2",{"id":84},"_11-conda方式",[86],{"type":24,"value":87},"1.1 Conda方式",{"type":18,"tag":26,"props":89,"children":90},{},[91],{"type":24,"value":92},"Conda是Anaconda提供的包&环境管理器，允许用户方便地安装软件包与该计算平台需要的所有库，可以理解为Conda是虚拟环境用来接管软件包和第三方库安装。",{"type":18,"tag":26,"props":94,"children":95},{},[96],{"type":24,"value":97},"首先，检查下系统是否为要求的版本。",{"type":18,"tag":26,"props":99,"children":100},{},[101],{"type":18,"tag":102,"props":103,"children":106},"img",{"alt":104,"src":105},"1.png","https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20225/5/1651713736658420635.png",[],{"type":18,"tag":26,"props":108,"children":109},{},[110,112,118],{"type":24,"value":111},"第二，下载并执行自动安装脚本（可以在官网安装页面获取脚本：",{"type":18,"tag":67,"props":113,"children":116},{"href":114,"rel":115},"https://www.mindspore.cn/install",[71],[117],{"type":24,"value":114},{"type":24,"value":119},"），运行过程中会完成安装所需依赖软件，创建Conda虚拟环境和安装MindSpore对应版本几个步骤。",{"type":18,"tag":26,"props":121,"children":122},{},[123],{"type":18,"tag":102,"props":124,"children":127},{"alt":125,"src":126},"图片1.png","https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20225/5/1651714137987977303.png",[],{"type":18,"tag":26,"props":129,"children":130},{},[131],{"type":24,"value":132},"第三，新打开终端窗口以使环境变量生效，自动安装脚本会为MindSpore创建名为“mindspore_pyXX”的虚拟环境，输入命令，激活Conda虚拟环境。",{"type":18,"tag":26,"props":134,"children":135},{},[136],{"type":18,"tag":102,"props":137,"children":140},{"alt":138,"src":139},"图片2.png","https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20225/5/1651714158934742125.png",[],{"type":18,"tag":26,"props":142,"children":143},{},[144],{"type":24,"value":145},"最后，便可以验证安装是否成功啦，如下图所示，出现了版本号就安装成功了。",{"type":18,"tag":26,"props":147,"children":148},{},[149],{"type":18,"tag":102,"props":150,"children":153},{"alt":151,"src":152},"图片3.png","https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20225/5/1651714174175146291.png",[],{"type":18,"tag":82,"props":155,"children":157},{"id":156},"_12-pip方式",[158],{"type":24,"value":159},"1.2 pip方式",{"type":18,"tag":26,"props":161,"children":162},{},[163],{"type":24,"value":164},"pip是Python包安装与管理的工具，提供了对Python包的查找、下载、安装和卸载的功能，pip安装MindSpore过程步骤与Conda安装过程也很类似~",{"type":18,"tag":26,"props":166,"children":167},{},[168],{"type":24,"value":169},"首先，依旧是确认系统版本为Ubuntu 18.04。",{"type":18,"tag":26,"props":171,"children":172},{},[173],{"type":24,"value":174},"第二，下载并执行自动安装脚本，不过和Conda有所不同的是，该脚本会通过APT安装Python3和pip3并且通过pip安装MindSpore对应版本。",{"type":18,"tag":26,"props":176,"children":177},{},[178],{"type":18,"tag":102,"props":179,"children":182},{"alt":180,"src":181},"图片4.png","https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20225/5/1651714215946803101.png",[],{"type":18,"tag":26,"props":184,"children":185},{},[186],{"type":24,"value":187},"最后，也需要重新打开终端窗口以使环境变量生效，就可以验证安装是否成功了。",{"type":18,"tag":82,"props":189,"children":191},{"id":190},"_13-source方式",[192],{"type":24,"value":193},"1.3 Source方式",{"type":18,"tag":26,"props":195,"children":196},{},[197],{"type":24,"value":198},"Source也就是源码安装，和上述两种方法相比通用性是最强的，那么这个安装方法大家是不是应该好好学习下~",{"type":18,"tag":26,"props":200,"children":201},{},[202],{"type":24,"value":203},"首先，依旧是确认系统版本为Ubuntu 18.04",{"type":18,"tag":26,"props":205,"children":206},{},[207],{"type":24,"value":208},"第二，下载并执行自动安装脚本，这边和前两者不同的是，安装的依赖项会有所变化。",{"type":18,"tag":26,"props":210,"children":211},{},[212],{"type":18,"tag":102,"props":213,"children":216},{"alt":214,"src":215},"图片5.png","https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20225/5/1651714342882396563.png",[],{"type":18,"tag":26,"props":218,"children":219},{},[220],{"type":24,"value":221},"第三，重新打开终端窗口以使环境变量生效后，需要输入命令从代码仓下载源码并执行编译",{"type":18,"tag":26,"props":223,"children":224},{},[225],{"type":18,"tag":102,"props":226,"children":229},{"alt":227,"src":228},"图片6.png","https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20225/5/1651714377235906387.png",[],{"type":18,"tag":26,"props":231,"children":232},{},[233],{"type":24,"value":234},"最后，输入pip命令安装MindSpore，完成后就可以验证安装是否成功了。",{"type":18,"tag":26,"props":236,"children":237},{},[238],{"type":18,"tag":102,"props":239,"children":242},{"alt":240,"src":241},"图片7.png","https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20225/5/1651714394224984164.png",[],{"type":18,"tag":19,"props":244,"children":246},{"id":245},"_2-手动安装",[247],{"type":24,"value":248},"2 手动安装",{"type":18,"tag":26,"props":250,"children":251},{},[252,254,259],{"type":24,"value":253},"如果已经安装过部分依赖，如Python、GCC等，可以使用手动安装MindSpore，手动当然也支持不同方式：pip、Source、Conda等，当然不同平台有不同的步骤与要求，不同方式有不同的依赖软件，安装过程按照官网安装指南（",{"type":18,"tag":67,"props":255,"children":257},{"href":114,"rel":256},[71],[258],{"type":24,"value":114},{"type":24,"value":260},"）即可。",{"type":18,"tag":26,"props":262,"children":263},{},[264,266],{"type":24,"value":265},"之前也写过《如何高效安装MindSpore的GPU版本》，感兴趣的同学可以参考体验：",{"type":18,"tag":67,"props":267,"children":270},{"href":268,"rel":269},"https://zhuanlan.zhihu.com/p/501903281",[71],[271],{"type":24,"value":268},{"type":18,"tag":19,"props":273,"children":275},{"id":274},"_3-手把手系列视频课程",[276],{"type":24,"value":277},"3 手把手系列视频课程",{"type":18,"tag":26,"props":279,"children":280},{},[281,283,290],{"type":24,"value":282},"除了文章上半部分的CPU-Ubuntu安装视频外，我们给大家准备了不同硬件平台、不同操作系统、多种方式的安装指导视频（属于《手把手安装与体验》系列课程：",{"type":18,"tag":67,"props":284,"children":287},{"href":285,"rel":286},"https://www.mindspore.cn/resources/courses/list?id=47#52",[71],[288],{"type":24,"value":289},"https://www.mindspore.cn/resources/courses/list?id=47#title52",{"type":24,"value":291},"），还包含一些依赖软件的安装指导，希望能给安装MindSpore的各位带来小小的帮助。",{"type":18,"tag":26,"props":293,"children":294},{},[295],{"type":18,"tag":102,"props":296,"children":298},{"alt":7,"src":297},"https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20225/5/1651714523493837729.png",[],{"type":18,"tag":26,"props":300,"children":301},{},[302],{"type":24,"value":303},"最后，为了更好的让开发者参与到MindSpore易用性的讨论中，我们成立了MindSpore的易用性SIG组。欢迎对MindSpore框架易用性提升有兴趣的朋友参与，扫描下面的二维码添加小助手（备注“易用性”），小助手拉你进群哦 ~",{"type":18,"tag":26,"props":305,"children":306},{},[307],{"type":18,"tag":102,"props":308,"children":311},{"alt":309,"src":310},"图片8.png","https://bbs-img.huaweicloud.com/data/forums/attachment/forum/20225/5/1651714547736150512.png",[],{"title":7,"searchDepth":313,"depth":313,"links":314},4,[315,317,318],{"id":84,"depth":316,"text":87},2,{"id":156,"depth":316,"text":159},{"id":190,"depth":316,"text":193},"markdown","content:technology-blogs:zh:1464.md","content","technology-blogs/zh/1464.md","technology-blogs/zh/1464","md",1776506112547]