[{"data":1,"prerenderedAt":904},["ShallowReactive",2],{"content-query-FaRgCgm2uD":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":898,"_id":899,"_source":900,"_file":901,"_stem":902,"_extension":903},"/technology-blogs/zh/364","zh",false,"","源码编译安装系列（一）：在Windows上进行源码编译安装MindSpore","体验在Windows上进行源码编译安装MindSpore","2020-12-31","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2020/12/30/ff9c85b9e6254899a1017419e43b0301.png","technology-blogs","安装",{"type":15,"children":16,"toc":877},"root",[17,25,40,51,65,70,75,81,86,93,106,115,123,131,136,142,156,164,172,180,188,193,199,212,220,228,236,242,272,280,288,296,302,307,336,344,350,371,379,387,392,397,406,411,416,421,429,434,442,447,452,457,494,500,506,527,532,540,548,554,559,567,572,580,593,601,606,611,619,627,632,640,648,653,661,669,677,690,711,719,732,740,758,764,769,777,785,790,827,832,840,845,853,858],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"源码编译安装系列一在windows上进行源码编译安装mindspore",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29,31],{"type":24,"value":30},"作者：",{"type":18,"tag":32,"props":33,"children":37},"a",{"href":34,"rel":35},"https://gitee.com/lvmingfu",[36],"nofollow",[38],{"type":24,"value":39},"吕明赋",{"type":18,"tag":26,"props":41,"children":42},{},[43,45],{"type":24,"value":44},"原贴地址：",{"type":18,"tag":32,"props":46,"children":49},{"href":47,"rel":48},"https://bbs.huaweicloud.com/forum/thread-97495-1-1.html",[36],[50],{"type":24,"value":47},{"type":18,"tag":26,"props":52,"children":53},{},[54,56,63],{"type":24,"value":55},"笔者一直使用MindSpore提供的whl包安装MindSpore，但是最近新版本一直还未出来，也看到了一位楼主在论坛反馈的问题",{"type":18,"tag":32,"props":57,"children":60},{"href":58,"rel":59},"https://bbs.huaweicloud.com/forum/thread-93032-1-1.html",[36],[61],{"type":24,"value":62},"BiggestFanMindSpore 多平台编译踩坑与用户初体验",{"type":24,"value":64},"，于是也尝试按照MindSpore官网提供的另一种安装方式--源码编译安装MindSpore。",{"type":18,"tag":26,"props":66,"children":67},{},[68],{"type":24,"value":69},"整个过程顺利的话差不多需要100分钟（笔者遇到大坑，多花了2个多小时，整个填坑之旅花费接近4个小时），其中下载安装依赖软件上大约花了10多分钟，编译MindSpore安装包耗时最长，需要80分钟左右，安装MindSpore需要1分钟左右。当然如果机器的配置好，网速棒，多开些线程应该可以节省一点时间。",{"type":18,"tag":26,"props":71,"children":72},{},[73],{"type":24,"value":74},"整个编译安装流程笔者将其总结如下文。",{"type":18,"tag":76,"props":77,"children":79},"h2",{"id":78},"下载依赖软件",[80],{"type":24,"value":78},{"type":18,"tag":26,"props":82,"children":83},{},[84],{"type":24,"value":85},"首先是下载相关的依赖软件，笔者建议在此步操作使用下载工具（如迅雷）进行，可以大幅提升下载效率。",{"type":18,"tag":87,"props":88,"children":90},"h3",{"id":89},"下载安装git",[91],{"type":24,"value":92},"下载安装Git",{"type":18,"tag":26,"props":94,"children":95},{},[96,98,104],{"type":24,"value":97},"下载安装git：",{"type":18,"tag":32,"props":99,"children":102},{"href":100,"rel":101},"https://github.com/git-for-windows/git/releases/download/v2.29.2.windows.2/Git-2.29.2.2-64-bit.exe",[36],[103],{"type":24,"value":100},{"type":24,"value":105},",下载后双击进入安装，过程如下图。",{"type":18,"tag":26,"props":107,"children":108},{},[109],{"type":18,"tag":110,"props":111,"children":114},"img",{"alt":112,"src":113},"git01.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173123fxoqa8kkinezr6re.png",[],{"type":18,"tag":26,"props":116,"children":117},{},[118],{"type":18,"tag":110,"props":119,"children":122},{"alt":120,"src":121},"git02.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173144h3ma0donvsxgbnb4.png",[],{"type":18,"tag":26,"props":124,"children":125},{},[126],{"type":18,"tag":110,"props":127,"children":130},{"alt":128,"src":129},"git03.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173156hxrchoozjbcgzdym.png",[],{"type":18,"tag":26,"props":132,"children":133},{},[134],{"type":24,"value":135},"默认安装路径为：C:\\Program Files\\Git 可以找到相关文件。",{"type":18,"tag":87,"props":137,"children":139},{"id":138},"下载安装python",[140],{"type":24,"value":141},"下载安装Python",{"type":18,"tag":26,"props":143,"children":144},{},[145,147,154],{"type":24,"value":146},"下载安装Python 3.7.5版本：",{"type":18,"tag":32,"props":148,"children":151},{"href":149,"rel":150},"https://bbs.huaweicloud.com/forum/thread-97495-1-1.html#",[36],[152],{"type":24,"value":153},"https://www.python.org/ftp/python/3.7.5/python-3.7.5-amd64.exe",{"type":24,"value":155}," ,下载后双击进入安装，过程如下图。",{"type":18,"tag":26,"props":157,"children":158},{},[159],{"type":18,"tag":110,"props":160,"children":163},{"alt":161,"src":162},"python01.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173256s72eeiipielmbt0r.png",[],{"type":18,"tag":26,"props":165,"children":166},{},[167],{"type":18,"tag":110,"props":168,"children":171},{"alt":169,"src":170},"python02.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173314knus0grzehu4cph7.png",[],{"type":18,"tag":26,"props":173,"children":174},{},[175],{"type":18,"tag":110,"props":176,"children":179},{"alt":177,"src":178},"python03.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173323i6fr9xykxpnzgepi.png",[],{"type":18,"tag":26,"props":181,"children":182},{},[183],{"type":18,"tag":110,"props":184,"children":187},{"alt":185,"src":186},"python04.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/1733297hd0frko6cdeppcu.png",[],{"type":18,"tag":26,"props":189,"children":190},{},[191],{"type":24,"value":192},"默认安装路径为： C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python 可以找到相关文件。",{"type":18,"tag":87,"props":194,"children":196},{"id":195},"下载安装activeperl",[197],{"type":24,"value":198},"下载安装ActivePerl",{"type":18,"tag":26,"props":200,"children":201},{},[202,204,210],{"type":24,"value":203},"下载ActivePerl 5.28.1.2801版本：",{"type":18,"tag":32,"props":205,"children":207},{"href":149,"rel":206},[36],[208],{"type":24,"value":209},"https://downloads.activestate.com/ActivePerl/releases/5.28.1.2801/ActivePerl-5.28.1.2801-MSWin32-x64-24563874.exe",{"type":24,"value":211}," 文件，并双击安装，过程如下图：",{"type":18,"tag":26,"props":213,"children":214},{},[215],{"type":18,"tag":110,"props":216,"children":219},{"alt":217,"src":218},"activeperl01.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173407azzglih3qmhtqv1m.png",[],{"type":18,"tag":26,"props":221,"children":222},{},[223],{"type":18,"tag":110,"props":224,"children":227},{"alt":225,"src":226},"activeperl02.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173417hfzungk0veryyd7y.png",[],{"type":18,"tag":26,"props":229,"children":230},{},[231],{"type":18,"tag":110,"props":232,"children":235},{"alt":233,"src":234},"activeperl03.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173424rjn9wk1nglwbrr7d.png",[],{"type":18,"tag":87,"props":237,"children":239},{"id":238},"下载解压gcc文件",[240],{"type":24,"value":241},"下载解压GCC文件",{"type":18,"tag":26,"props":243,"children":244},{},[245,247,253,255,262,264,270],{"type":24,"value":246},"下载MinGW-W64 GCC-7.3.0：",{"type":18,"tag":32,"props":248,"children":251},{"href":249,"rel":250},"https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/7.3.0/threads-posix/seh/x86_64-7.3.0-release-posix-seh-rt_v5-rev0.7z",[36],[252],{"type":24,"value":249},{"type":24,"value":254},"，并解压，笔者将",{"type":18,"tag":256,"props":257,"children":259},"code",{"className":258},[],[260],{"type":24,"value":261},"mingw64",{"type":24,"value":263},"文件夹整体移到",{"type":18,"tag":256,"props":265,"children":267},{"className":266},[],[268],{"type":24,"value":269},"D:/a_tool/gcc",{"type":24,"value":271},"文件夹，后续操作需要将gcc的路径添加到系统环境变量。当然也可以放置在其他路径中，但需注意：存放路径不能存在中文和日文。",{"type":18,"tag":26,"props":273,"children":274},{},[275],{"type":18,"tag":110,"props":276,"children":279},{"alt":277,"src":278},"gcc01.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173501fougwdj413df1wmw.png",[],{"type":18,"tag":26,"props":281,"children":282},{},[283],{"type":18,"tag":110,"props":284,"children":287},{"alt":285,"src":286},"gcc02.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173512nxffvjmsfxbjbpbm.png",[],{"type":18,"tag":26,"props":289,"children":290},{},[291],{"type":18,"tag":110,"props":292,"children":295},{"alt":293,"src":294},"gcc03.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173523d9zngttuiyhf6nr7.png",[],{"type":18,"tag":87,"props":297,"children":299},{"id":298},"下载解压cmake文件",[300],{"type":24,"value":301},"下载解压CMake文件",{"type":18,"tag":26,"props":303,"children":304},{},[305],{"type":24,"value":306},"下载后解压缩并存放到指定位置，",{"type":18,"tag":26,"props":308,"children":309},{},[310,312,318,320,326,328,334],{"type":24,"value":311},"下载CMake 3.18.3版本：",{"type":18,"tag":32,"props":313,"children":316},{"href":314,"rel":315},"https://github.com/Kitware/Cmake/releases/tag/v3.18.3",[36],[317],{"type":24,"value":314},{"type":24,"value":319}," ，笔者使用Windows 10 64位系统，选择下载",{"type":18,"tag":256,"props":321,"children":323},{"className":322},[],[324],{"type":24,"value":325},"cmake-3.18.3-win64-x64.zip",{"type":24,"value":327},"将此文件夹解压在",{"type":18,"tag":256,"props":329,"children":331},{"className":330},[],[332],{"type":24,"value":333},"D:/a_tool",{"type":24,"value":335},"文件夹，后续需要将cmake的路径添加到系统环境变量。当然也可以放置在其他路径中，但需注意：存放路径不能存在中文和日文。",{"type":18,"tag":26,"props":337,"children":338},{},[339],{"type":18,"tag":110,"props":340,"children":343},{"alt":341,"src":342},"cmake01.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/17355421qtsxl1ect0mhel.png",[],{"type":18,"tag":87,"props":345,"children":347},{"id":346},"下载visual-c",[348],{"type":24,"value":349},"下载Visual C++",{"type":18,"tag":26,"props":351,"children":352},{},[353,355,361,363,369],{"type":24,"value":354},"下载Visual C++ Redistributable for Visual Studio 2015：",{"type":18,"tag":32,"props":356,"children":358},{"href":149,"rel":357},[36],[359],{"type":24,"value":360},"https://www.microsoft.com/zh-CN/download/details.aspx?id=48145",{"type":24,"value":362}," ，笔者使用Windows 10 64位系统，如果与笔者环境一致也可直接从这下载：",{"type":18,"tag":32,"props":364,"children":366},{"href":149,"rel":365},[36],[367],{"type":24,"value":368},"https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe",{"type":24,"value":370},"，下载后双击安装，过程如下图：",{"type":18,"tag":26,"props":372,"children":373},{},[374],{"type":18,"tag":110,"props":375,"children":378},{"alt":376,"src":377},"vc01.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173630ld0stxwbqafulfhg.png",[],{"type":18,"tag":26,"props":380,"children":381},{},[382],{"type":18,"tag":110,"props":383,"children":386},{"alt":384,"src":385},"vc02.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/1736404lwlfciddozm24j9.png",[],{"type":18,"tag":87,"props":388,"children":390},{"id":389},"安装wheel",[391],{"type":24,"value":389},{"type":18,"tag":26,"props":393,"children":394},{},[395],{"type":24,"value":396},"打开cmd命令行，输入命令，安装对应的依赖：",{"type":18,"tag":398,"props":399,"children":401},"pre",{"code":400},"pip install wheel -i https://pypi.tuna.tsinghua.edu.cn/simple\n",[402],{"type":18,"tag":256,"props":403,"children":404},{"__ignoreMap":7},[405],{"type":24,"value":400},{"type":18,"tag":76,"props":407,"children":409},{"id":408},"添加系统环境变量",[410],{"type":24,"value":408},{"type":18,"tag":26,"props":412,"children":413},{},[414],{"type":24,"value":415},"通过下述过程进入系统环境变量编辑界面：",{"type":18,"tag":26,"props":417,"children":418},{},[419],{"type":24,"value":420},"控制面板->系统->高级系统设置",{"type":18,"tag":26,"props":422,"children":423},{},[424],{"type":18,"tag":110,"props":425,"children":428},{"alt":426,"src":427},"env01.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173713zzekj0ux3ej5n6jq.png",[],{"type":18,"tag":26,"props":430,"children":431},{},[432],{"type":24,"value":433},"->环境变量->系统环境变量->Path->编辑，最后出现下图界面。",{"type":18,"tag":26,"props":435,"children":436},{},[437],{"type":18,"tag":110,"props":438,"children":441},{"alt":439,"src":440},"env02.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173739lblfgsvzu6gdtgdl.png",[],{"type":18,"tag":26,"props":443,"children":444},{},[445],{"type":24,"value":446},"点击新建添加新的环境变量：",{"type":18,"tag":26,"props":448,"children":449},{},[450],{"type":24,"value":451},"添加方法：",{"type":18,"tag":26,"props":453,"children":454},{},[455],{"type":24,"value":456},"如果跟笔者的安装步骤一致，则直接将下述路径复制添加到系统环境变量中即可：",{"type":18,"tag":26,"props":458,"children":459},{},[460,462,468,470,476,478,484,486,492],{"type":24,"value":461},"添加Python路径到系统环境变量：",{"type":18,"tag":256,"props":463,"children":465},{"className":464},[],[466],{"type":24,"value":467},"C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37",{"type":24,"value":469},"。 添加pip路径到系统环境变量：",{"type":18,"tag":256,"props":471,"children":473},{"className":472},[],[474],{"type":24,"value":475},"C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python37\\Scripts",{"type":24,"value":477},"。 添加GCC-7.3.0路径到系统环境变量：",{"type":18,"tag":256,"props":479,"children":481},{"className":480},[],[482],{"type":24,"value":483},"D:\\a_tool\\gcc\\mingw64\\bin",{"type":24,"value":485},"。 添加Cmake路径到系统环境变量：",{"type":18,"tag":256,"props":487,"children":489},{"className":488},[],[490],{"type":24,"value":491},"D:\\a_tool\\cmake-3.18.3-win64-x64\\bin",{"type":24,"value":493},"。 添加完成后，所有的界面点击确定即完成添加。",{"type":18,"tag":76,"props":495,"children":497},{"id":496},"下载编译mindspore",[498],{"type":24,"value":499},"下载编译MindSpore",{"type":18,"tag":87,"props":501,"children":503},{"id":502},"通过git下载mindspore仓",[504],{"type":24,"value":505},"通过git下载MindSpore仓",{"type":18,"tag":26,"props":507,"children":508},{},[509,511,517,519,525],{"type":24,"value":510},"在",{"type":18,"tag":256,"props":512,"children":514},{"className":513},[],[515],{"type":24,"value":516},"D:/atestwarehouse",{"type":24,"value":518},"文件夹中空白处右击，选择",{"type":18,"tag":256,"props":520,"children":522},{"className":521},[],[523],{"type":24,"value":524},"Git Bash Here",{"type":24,"value":526},"。",{"type":18,"tag":26,"props":528,"children":529},{},[530],{"type":24,"value":531},"输入命令，即可自动下载MindSpore仓的所有文件：",{"type":18,"tag":398,"props":533,"children":535},{"code":534},"git clone https://gitee.com/mindspore/mindspore.git\n",[536],{"type":18,"tag":256,"props":537,"children":538},{"__ignoreMap":7},[539],{"type":24,"value":534},{"type":18,"tag":26,"props":541,"children":542},{},[543],{"type":18,"tag":110,"props":544,"children":547},{"alt":545,"src":546},"mindspore01.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173831i1ijqjczwnoswfwq.png",[],{"type":18,"tag":87,"props":549,"children":551},{"id":550},"编译mindspore",[552],{"type":24,"value":553},"编译MindSpore",{"type":18,"tag":26,"props":555,"children":556},{},[557],{"type":24,"value":558},"下载完成后，打开win+r，打开运行，输入cmd回车进入命令行：",{"type":18,"tag":26,"props":560,"children":561},{},[562],{"type":18,"tag":110,"props":563,"children":566},{"alt":564,"src":565},"win_run.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173905x9v8vmv0vtadv6vg.png",[],{"type":18,"tag":26,"props":568,"children":569},{},[570],{"type":24,"value":571},"进入git下载下来的MindSpore文件夹目录，并输入编译命令：",{"type":18,"tag":398,"props":573,"children":575},{"code":574},"call build.bat 12\n",[576],{"type":18,"tag":256,"props":577,"children":578},{"__ignoreMap":7},[579],{"type":24,"value":574},{"type":18,"tag":26,"props":581,"children":582},{},[583,585,591],{"type":24,"value":584},"其中",{"type":18,"tag":256,"props":586,"children":588},{"className":587},[],[589],{"type":24,"value":590},"12",{"type":24,"value":592},"为线程数量，配置好的机器可以调整更高的数值，加快编译速度，如果不设置数值，文件默认启动8线程编译。",{"type":18,"tag":26,"props":594,"children":595},{},[596],{"type":18,"tag":110,"props":597,"children":600},{"alt":598,"src":599},"build01.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173939cjhtlxtwqj0d2uzq.png",[],{"type":18,"tag":26,"props":602,"children":603},{},[604],{"type":24,"value":605},"自动进入编译状态，整个编译过程大约80分钟。",{"type":18,"tag":26,"props":607,"children":608},{},[609],{"type":24,"value":610},"第一阶段：下载各种相关的依赖包，然后检查编译：",{"type":18,"tag":26,"props":612,"children":613},{},[614],{"type":18,"tag":110,"props":615,"children":618},{"alt":616,"src":617},"build02.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/173958mdm0k4ubkfscu5gb.png",[],{"type":18,"tag":26,"props":620,"children":621},{},[622],{"type":18,"tag":110,"props":623,"children":626},{"alt":624,"src":625},"build03.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/174003stp4ghdhsq426qa9.png",[],{"type":18,"tag":26,"props":628,"children":629},{},[630],{"type":24,"value":631},"第二阶段：核心编译，相关算子的编译：",{"type":18,"tag":26,"props":633,"children":634},{},[635],{"type":18,"tag":110,"props":636,"children":639},{"alt":637,"src":638},"build04.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/1740249alr8edbobtxpsug.png",[],{"type":18,"tag":26,"props":641,"children":642},{},[643],{"type":18,"tag":110,"props":644,"children":647},{"alt":645,"src":646},"build05.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/174031rj9r4qme0o1sz6m6.png",[],{"type":18,"tag":26,"props":649,"children":650},{},[651],{"type":24,"value":652},"第三阶段：添加MindSpore的py文件到安装包文件：",{"type":18,"tag":26,"props":654,"children":655},{},[656],{"type":18,"tag":110,"props":657,"children":660},{"alt":658,"src":659},"build06.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/1740505r6s2wzvc6gel1m9.png",[],{"type":18,"tag":26,"props":662,"children":663},{},[664],{"type":18,"tag":110,"props":665,"children":668},{"alt":666,"src":667},"build07.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/174057lbbwedriyrzgyibl.png",[],{"type":18,"tag":26,"props":670,"children":671},{},[672],{"type":18,"tag":110,"props":673,"children":676},{"alt":674,"src":675},"build08.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/174110edjh8mnpkwtmickg.png",[],{"type":18,"tag":26,"props":678,"children":679},{},[680,682,688],{"type":24,"value":681},"最后提示：",{"type":18,"tag":256,"props":683,"children":685},{"className":684},[],[686],{"type":24,"value":687},"D:/atestwarehouse/mindspore/build/mindspore/mindspore_generated.",{"type":24,"value":689},"编译完毕。",{"type":18,"tag":26,"props":691,"children":692},{},[693,695,701,703,709],{"type":24,"value":694},"可以在目录",{"type":18,"tag":256,"props":696,"children":698},{"className":697},[],[699],{"type":24,"value":700},"D:/atestwarehouse/mindspore/build/package",{"type":24,"value":702},"找到编译完成的MindSpore安装文件，",{"type":18,"tag":256,"props":704,"children":706},{"className":705},[],[707],{"type":24,"value":708},"mindspore-{version}-cp37-cp37m-win_amd64.whl",{"type":24,"value":710},"，verison为版本号，此例中{version}为1.1.0。",{"type":18,"tag":26,"props":712,"children":713},{},[714],{"type":18,"tag":110,"props":715,"children":718},{"alt":716,"src":717},"build09.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/174139kezsgzr2z8yq9vcz.png",[],{"type":18,"tag":26,"props":720,"children":721},{},[722,724,730],{"type":24,"value":723},"同时也可以在目录",{"type":18,"tag":256,"props":725,"children":727},{"className":726},[],[728],{"type":24,"value":729},"./mindspore/output",{"type":24,"value":731},"找到编译好的文件及相关的校验文件：",{"type":18,"tag":26,"props":733,"children":734},{},[735],{"type":18,"tag":110,"props":736,"children":739},{"alt":737,"src":738},"build10.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/1741541epz0m7cqb2daqzd.png",[],{"type":18,"tag":741,"props":742,"children":743},"blockquote",{},[744],{"type":18,"tag":26,"props":745,"children":746},{},[747,749,756],{"type":24,"value":748},"安装过程出现光标长时间闪烁不动的情况，可以通过Ctrl+C终止编译过程，然后在MindSpore中重新输入编译命令。 如果系统安装过Anaconda软件，可能在编译过程中出现依赖软件的路径指向问题，需要到注册表中调整指向，具体问题实在不能解决时，可以到",{"type":18,"tag":32,"props":750,"children":753},{"href":751,"rel":752},"https://bbs.huaweicloud.com/forum/forum-1076-1.html",[36],[754],{"type":24,"value":755},"昇腾论坛MindSpore专区",{"type":24,"value":757},"将报错信息和截图进行发帖咨询，论坛有专人快速响应帮助解决。 笔者就在这两个大坑里面转悠了许久。",{"type":18,"tag":76,"props":759,"children":761},{"id":760},"安装mindspore",[762],{"type":24,"value":763},"安装MindSpore",{"type":18,"tag":26,"props":765,"children":766},{},[767],{"type":24,"value":768},"进入到安装文件的文件夹，输入以下命令进行安装：",{"type":18,"tag":398,"props":770,"children":772},{"code":771},"pip install mindspore-{version}-cp37-cp37m-win_amd64.whl -i https://pypi.tuna.tsinghua.edu.cn/simple\n",[773],{"type":18,"tag":256,"props":774,"children":775},{"__ignoreMap":7},[776],{"type":24,"value":771},{"type":18,"tag":26,"props":778,"children":779},{},[780],{"type":18,"tag":110,"props":781,"children":784},{"alt":782,"src":783},"install_mindspore01.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/26/1439215e6gnjr2hf9ezifu.png",[],{"type":18,"tag":26,"props":786,"children":787},{},[788],{"type":24,"value":789},"其中：",{"type":18,"tag":791,"props":792,"children":793},"ul",{},[794,809],{"type":18,"tag":795,"props":796,"children":797},"li",{},[798,800,807],{"type":24,"value":799},"在联网状态下，安装whl包时会自动下载MindSpore安装包的依赖项（依赖项详情参见",{"type":18,"tag":32,"props":801,"children":804},{"href":802,"rel":803},"https://gitee.com/mindspore/mindspore/blob/master/requirements.txt",[36],[805],{"type":24,"value":806},"requirements.txt",{"type":24,"value":808},"），其余情况需自行安装。",{"type":18,"tag":795,"props":810,"children":811},{},[812,818,820,825],{"type":18,"tag":256,"props":813,"children":815},{"className":814},[],[816],{"type":24,"value":817},"{version}",{"type":24,"value":819},"表示MindSpore版本号，例如安装1.1.0版本MindSpore时，",{"type":18,"tag":256,"props":821,"children":823},{"className":822},[],[824],{"type":24,"value":817},{"type":24,"value":826},"应写为1.1.0。",{"type":18,"tag":76,"props":828,"children":830},{"id":829},"验证是否安装成功",[831],{"type":24,"value":829},{"type":18,"tag":398,"props":833,"children":835},{"code":834},"python -c \"import mindspore;print(mindspore.__version__)\"\n",[836],{"type":18,"tag":256,"props":837,"children":838},{"__ignoreMap":7},[839],{"type":24,"value":834},{"type":18,"tag":26,"props":841,"children":842},{},[843],{"type":24,"value":844},"下图中的验证方法等效于上面的命令：",{"type":18,"tag":26,"props":846,"children":847},{},[848],{"type":18,"tag":110,"props":849,"children":852},{"alt":850,"src":851},"check_install01.PNG","https://bbs-img-cbc-cn.obs.cn-north-1.myhuaweicloud.com/data/attachment/forum/202012/25/174335vxqwouqpx1vnpkmt.png",[],{"type":18,"tag":26,"props":854,"children":855},{},[856],{"type":24,"value":857},"以上就是笔者在Windows 10上编译安装MindSpore的全部体验。",{"type":18,"tag":26,"props":859,"children":860},{},[861,863,868,870],{"type":24,"value":862},"参考文档： ",{"type":18,"tag":32,"props":864,"children":866},{"href":58,"rel":865},[36],[867],{"type":24,"value":62},{"type":24,"value":869}," ",{"type":18,"tag":32,"props":871,"children":874},{"href":872,"rel":873},"https://www.mindspore.cn/install",[36],[875],{"type":24,"value":876},"MindSpore的安装",{"title":7,"searchDepth":878,"depth":878,"links":879},4,[880,891,892,896,897],{"id":78,"depth":881,"text":78,"children":882},2,[883,885,886,887,888,889,890],{"id":89,"depth":884,"text":92},3,{"id":138,"depth":884,"text":141},{"id":195,"depth":884,"text":198},{"id":238,"depth":884,"text":241},{"id":298,"depth":884,"text":301},{"id":346,"depth":884,"text":349},{"id":389,"depth":884,"text":389},{"id":408,"depth":881,"text":408},{"id":496,"depth":881,"text":499,"children":893},[894,895],{"id":502,"depth":884,"text":505},{"id":550,"depth":884,"text":553},{"id":760,"depth":881,"text":763},{"id":829,"depth":881,"text":829},"markdown","content:technology-blogs:zh:364.md","content","technology-blogs/zh/364.md","technology-blogs/zh/364","md",1776506132633]