[{"data":1,"prerenderedAt":671},["ShallowReactive",2],{"content-query-uDKSs3vl5L":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":665,"_id":666,"_source":667,"_file":668,"_stem":669,"_extension":670},"/technology-blogs/en/3440","en",false,"","Operation Guide for MindSpore Quantum Local Installation","1. Installing the Python programming environment","2024-06-14","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/11/28/ae2d4bc6917f4f44962c0067cb408041.png","technology-blogs","Practices",{"type":15,"children":16,"toc":658},"root",[17,25,34,39,55,77,85,90,97,102,109,114,126,133,152,159,164,176,183,191,196,201,206,225,237,244,249,254,263,270,280,285,296,300,310,326,331,340,355,359,368,377,381,385,389,404,413,417,421,429,434,446,458,466,471,476,483,491,503,508,513,518,534,541,546,551,558,566,571,576,583,588,593,600,605,610,617,625,644,649],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"operation-guide-for-mindspore-quantum-local-installation",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29],{"type":18,"tag":30,"props":31,"children":32},"strong",{},[33],{"type":24,"value":9},{"type":18,"tag":26,"props":35,"children":36},{},[37],{"type":24,"value":38},"(If you have installed Python or Anaconda, skip this step.)",{"type":18,"tag":26,"props":40,"children":41},{},[42,44,53],{"type":24,"value":43},"Go to the ",{"type":18,"tag":45,"props":46,"children":50},"a",{"href":47,"rel":48},"https://www.python.org/downloads/release/python-390/",[49],"nofollow",[51],{"type":24,"value":52},"Python official website",{"type":24,"value":54}," and select a proper version based on your operating system (Windows, Mac, or Linux). Python 3.9.0 is recommended. (MindQuantum supports Python 3.7 to 3.9.)",{"type":18,"tag":26,"props":56,"children":57},{},[58,60,67,69,75],{"type":24,"value":59},"(If you cannot access the Python official website or the download speed is slow, you are advised to download the installation package of the corresponding version by using images of ",{"type":18,"tag":45,"props":61,"children":64},{"href":62,"rel":63},"https://mirrors.huaweicloud.com/python/3.9.0/",[49],[65],{"type":24,"value":66},"Huawei Mirrors",{"type":24,"value":68}," or the third-party source (",{"type":18,"tag":45,"props":70,"children":73},{"href":71,"rel":72},"https://registry.npmmirror.com/binary.html?path=python/3.9.0/",[49],[74],{"type":24,"value":71},{"type":24,"value":76},")).",{"type":18,"tag":26,"props":78,"children":79},{},[80],{"type":18,"tag":81,"props":82,"children":84},"img",{"alt":7,"src":83},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/5d67c26224a84dfb9e048b1053ee3cac.png",[],{"type":18,"tag":26,"props":86,"children":87},{},[88],{"type":24,"value":89},"Scroll down to the bottom of the page, as shown in the following figure, and select the corresponding version for installation.",{"type":18,"tag":26,"props":91,"children":92},{},[93],{"type":18,"tag":81,"props":94,"children":96},{"alt":7,"src":95},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/72ce8b56fc2b4dfb8a32d76d2fa213c1.png",[],{"type":18,"tag":26,"props":98,"children":99},{},[100],{"type":24,"value":101},"Python installation packages on the official website",{"type":18,"tag":26,"props":103,"children":104},{},[105],{"type":18,"tag":81,"props":106,"children":108},{"alt":7,"src":107},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/a7882ecccc7a44f5aff498dea8adbefa.png",[],{"type":18,"tag":26,"props":110,"children":111},{},[112],{"type":24,"value":113},"Python installation packages on Huawei Mirrors",{"type":18,"tag":26,"props":115,"children":116},{},[117,119,124],{"type":24,"value":118},"Note: During the installation, select ",{"type":18,"tag":30,"props":120,"children":121},{},[122],{"type":24,"value":123},"Add Python 3.9 to PATH",{"type":24,"value":125}," to automatically set the environment variables.",{"type":18,"tag":26,"props":127,"children":128},{},[129],{"type":18,"tag":81,"props":130,"children":132},{"alt":7,"src":131},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/d18d7881e0554f6a881474b41435205c.png",[],{"type":18,"tag":26,"props":134,"children":135},{},[136,138,143,145,150],{"type":24,"value":137},"After installation, click the Windows icon at the lower left corner, select the ",{"type":18,"tag":30,"props":139,"children":140},{},[141],{"type":24,"value":142},"Command Prompt",{"type":24,"value":144}," and enter ",{"type":18,"tag":30,"props":146,"children":147},{},[148],{"type":24,"value":149},"python",{"type":24,"value":151}," to access the interactive environment, as shown in the following figure.",{"type":18,"tag":26,"props":153,"children":154},{},[155],{"type":18,"tag":81,"props":156,"children":158},{"alt":7,"src":157},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/d7f16a8f042f4c82a2ab84a78af09cf2.png",[],{"type":18,"tag":26,"props":160,"children":161},{},[162],{"type":24,"value":163},"If the version number is displayed, the installation is successful. Otherwise, the installation fails.",{"type":18,"tag":26,"props":165,"children":166},{},[167,169,174],{"type":24,"value":168},"Enter ",{"type":18,"tag":30,"props":170,"children":171},{},[172],{"type":24,"value":173},"quit ()",{"type":24,"value":175}," to exit the interactive environment.",{"type":18,"tag":26,"props":177,"children":178},{},[179],{"type":18,"tag":81,"props":180,"children":182},{"alt":7,"src":181},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/a79997b0464d4184b42120f4ad894039.png",[],{"type":18,"tag":26,"props":184,"children":185},{},[186],{"type":18,"tag":30,"props":187,"children":188},{},[189],{"type":24,"value":190},"2. Installing MindQuantum",{"type":18,"tag":26,"props":192,"children":193},{},[194],{"type":24,"value":195},"Open the terminal and use pip to install the software. Enter the following command:",{"type":18,"tag":26,"props":197,"children":198},{},[199],{"type":24,"value":200},"pip install mindquantum",{"type":18,"tag":26,"props":202,"children":203},{},[204],{"type":24,"value":205},"# If a message is displayed indicating that the network is faulty, you can set the download source to Huawei source, or Tsinghua source.",{"type":18,"tag":26,"props":207,"children":208},{},[209,211,217,219],{"type":24,"value":210},"pip install mindquantum --trusted-host ",{"type":18,"tag":45,"props":212,"children":215},{"href":213,"rel":214},"https://mirrors.huaweicloud.com",[49],[216],{"type":24,"value":213},{"type":24,"value":218}," -i ",{"type":18,"tag":45,"props":220,"children":223},{"href":221,"rel":222},"https://mirrors.huaweicloud.com/repository/pypi/simple",[49],[224],{"type":24,"value":221},{"type":18,"tag":26,"props":226,"children":227},{},[228,230],{"type":24,"value":229},"pip install mindquantum -i ",{"type":18,"tag":45,"props":231,"children":234},{"href":232,"rel":233},"https://mirrors.tuna.tsinghua.edu.cn/",[49],[235],{"type":24,"value":236},"https://mirrors.tuna.tsinghua.edu.cn",{"type":18,"tag":26,"props":238,"children":239},{},[240],{"type":18,"tag":81,"props":241,"children":243},{"alt":7,"src":242},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/5011e9ceaaac40a8ae5f7351bb1d3c59.png",[],{"type":18,"tag":26,"props":245,"children":246},{},[247],{"type":24,"value":248},"If an error occurs during online pip installation, download the .whl package for local installation.",{"type":18,"tag":26,"props":250,"children":251},{},[252],{"type":24,"value":253},"Click the following link to download the .whl package of the corresponding OS.",{"type":18,"tag":26,"props":255,"children":256},{},[257],{"type":18,"tag":45,"props":258,"children":261},{"href":259,"rel":260},"https://pypi.org/project/mindquantum/0.9.11/#files",[49],[262],{"type":24,"value":259},{"type":18,"tag":26,"props":264,"children":265},{},[266],{"type":18,"tag":81,"props":267,"children":269},{"alt":7,"src":268},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/f0a4a2a2a0424c0e83d06e0273243abc.png",[],{"type":18,"tag":271,"props":272,"children":274},"h3",{"id":273},"operation-guide-for-mindspore-quantum-local-installation-mindspore",[275],{"type":18,"tag":30,"props":276,"children":277},{},[278],{"type":24,"value":279},"Operation Guide for MindSpore Quantum Local Installation MindSpore",{"type":18,"tag":26,"props":281,"children":282},{},[283],{"type":24,"value":284},"Posted on 2024-06-14 10:04:0134",{"type":18,"tag":19,"props":286,"children":288},{"id":287},"_1-installing-the-python-programming-environment",[289,294],{"type":18,"tag":30,"props":290,"children":291},{},[292],{"type":24,"value":293},"1.",{"type":24,"value":295}," Installing the Python programming environment",{"type":18,"tag":26,"props":297,"children":298},{},[299],{"type":24,"value":38},{"type":18,"tag":26,"props":301,"children":302},{},[303,304,309],{"type":24,"value":43},{"type":18,"tag":45,"props":305,"children":307},{"href":47,"rel":306},[49],[308],{"type":24,"value":52},{"type":24,"value":54},{"type":18,"tag":26,"props":311,"children":312},{},[313,314,319,320,325],{"type":24,"value":59},{"type":18,"tag":45,"props":315,"children":317},{"href":62,"rel":316},[49],[318],{"type":24,"value":66},{"type":24,"value":68},{"type":18,"tag":45,"props":321,"children":323},{"href":71,"rel":322},[49],[324],{"type":24,"value":71},{"type":24,"value":76},{"type":18,"tag":26,"props":327,"children":328},{},[329],{"type":24,"value":330},"Scroll down to the bottom of the page, and select the corresponding version for installation.",{"type":18,"tag":26,"props":332,"children":333},{},[334,335,339],{"type":24,"value":118},{"type":18,"tag":30,"props":336,"children":337},{},[338],{"type":24,"value":123},{"type":24,"value":125},{"type":18,"tag":26,"props":341,"children":342},{},[343,344,348,349,353],{"type":24,"value":137},{"type":18,"tag":30,"props":345,"children":346},{},[347],{"type":24,"value":142},{"type":24,"value":144},{"type":18,"tag":30,"props":350,"children":351},{},[352],{"type":24,"value":149},{"type":24,"value":354}," to access the interactive environment.",{"type":18,"tag":26,"props":356,"children":357},{},[358],{"type":24,"value":163},{"type":18,"tag":26,"props":360,"children":361},{},[362,363,367],{"type":24,"value":168},{"type":18,"tag":30,"props":364,"children":365},{},[366],{"type":24,"value":173},{"type":24,"value":175},{"type":18,"tag":369,"props":370,"children":372},"h2",{"id":371},"_2-installing-mindquantum",[373],{"type":18,"tag":30,"props":374,"children":375},{},[376],{"type":24,"value":190},{"type":18,"tag":26,"props":378,"children":379},{},[380],{"type":24,"value":195},{"type":18,"tag":26,"props":382,"children":383},{},[384],{"type":24,"value":200},{"type":18,"tag":26,"props":386,"children":387},{},[388],{"type":24,"value":205},{"type":18,"tag":26,"props":390,"children":391},{},[392,393,398,399],{"type":24,"value":210},{"type":18,"tag":45,"props":394,"children":396},{"href":213,"rel":395},[49],[397],{"type":24,"value":213},{"type":24,"value":218},{"type":18,"tag":45,"props":400,"children":402},{"href":221,"rel":401},[49],[403],{"type":24,"value":221},{"type":18,"tag":26,"props":405,"children":406},{},[407,408],{"type":24,"value":229},{"type":18,"tag":45,"props":409,"children":411},{"href":232,"rel":410},[49],[412],{"type":24,"value":236},{"type":18,"tag":26,"props":414,"children":415},{},[416],{"type":24,"value":248},{"type":18,"tag":26,"props":418,"children":419},{},[420],{"type":24,"value":253},{"type":18,"tag":26,"props":422,"children":423},{},[424],{"type":18,"tag":45,"props":425,"children":427},{"href":259,"rel":426},[49],[428],{"type":24,"value":259},{"type":18,"tag":26,"props":430,"children":431},{},[432],{"type":24,"value":433},"Open the terminal, and run the command:",{"type":18,"tag":26,"props":435,"children":436},{},[437,439,444],{"type":24,"value":438},"pip install ",{"type":18,"tag":30,"props":440,"children":441},{},[442],{"type":24,"value":443},"***",{"type":24,"value":445},"\\mindquantum-0.9.11-cp39-cp39-win_amd64.whl",{"type":18,"tag":26,"props":447,"children":448},{},[449,451,456],{"type":24,"value":450},"# Example: pip install ",{"type":18,"tag":30,"props":452,"children":453},{},[454],{"type":24,"value":455},"C:\\Users\\XXX\\Downloads",{"type":24,"value":457}," \\mindquantum-0.9.11-cp39-cp39-win_amd64.whl",{"type":18,"tag":26,"props":459,"children":460},{},[461],{"type":18,"tag":30,"props":462,"children":463},{},[464],{"type":24,"value":465},"# *** indicates the path of the .whl package, for example, C:\\Users\\XXX\\Downloads.",{"type":18,"tag":26,"props":467,"children":468},{},[469],{"type":24,"value":470},"After the installation, run the following command on the terminal. If the MindQuantum version number is displayed, the installation is complete.",{"type":18,"tag":26,"props":472,"children":473},{},[474],{"type":24,"value":475},"pip show mindquantum",{"type":18,"tag":26,"props":477,"children":478},{},[479],{"type":18,"tag":81,"props":480,"children":482},{"alt":7,"src":481},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/ddb2fc5805684dbba2fbd5860ae53068.png",[],{"type":18,"tag":26,"props":484,"children":485},{},[486],{"type":18,"tag":30,"props":487,"children":488},{},[489],{"type":24,"value":490},"3. Installing MindSpore",{"type":18,"tag":26,"props":492,"children":493},{},[494,496,501],{"type":24,"value":495},"(",{"type":18,"tag":30,"props":497,"children":498},{},[499],{"type":24,"value":500},"Optional",{"type":24,"value":502},". In the quantum machine learning field, the neural network and optimizer of MindSpore can be used.)",{"type":18,"tag":26,"props":504,"children":505},{},[506],{"type":24,"value":507},"Open the terminal, use pip to install the software, and enter the following command:",{"type":18,"tag":26,"props":509,"children":510},{},[511],{"type":24,"value":512},"pip install mindspore",{"type":18,"tag":26,"props":514,"children":515},{},[516],{"type":24,"value":517},"# If a message is displayed indicating that the network is faulty, set the download source to Huawei source.",{"type":18,"tag":26,"props":519,"children":520},{},[521,523,528,529],{"type":24,"value":522},"pip install mindspore --trusted-host ",{"type":18,"tag":45,"props":524,"children":526},{"href":213,"rel":525},[49],[527],{"type":24,"value":213},{"type":24,"value":218},{"type":18,"tag":45,"props":530,"children":532},{"href":221,"rel":531},[49],[533],{"type":24,"value":221},{"type":18,"tag":26,"props":535,"children":536},{},[537],{"type":18,"tag":81,"props":538,"children":540},{"alt":7,"src":539},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/0e6b5d0ceb534eeba982b59338c46cb1.png",[],{"type":18,"tag":26,"props":542,"children":543},{},[544],{"type":24,"value":545},"After the installation, run the following command on the terminal. If the MindSpore version number is displayed, the installation is complete.",{"type":18,"tag":26,"props":547,"children":548},{},[549],{"type":24,"value":550},"pip show mindspore",{"type":18,"tag":26,"props":552,"children":553},{},[554],{"type":18,"tag":81,"props":555,"children":557},{"alt":7,"src":556},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/d80989e46fd9481fb48448ebcb49d6cc.png",[],{"type":18,"tag":26,"props":559,"children":560},{},[561],{"type":18,"tag":30,"props":562,"children":563},{},[564],{"type":24,"value":565},"4. Installing Jupyter",{"type":18,"tag":26,"props":567,"children":568},{},[569],{"type":24,"value":570},"Install Jupyter on the local computer and use JupyterLab for programming, which is similar to that of setting the JupyterLab programming environment on the Quantum cloud.",{"type":18,"tag":26,"props":572,"children":573},{},[574],{"type":24,"value":575},"pip install jupyter",{"type":18,"tag":26,"props":577,"children":578},{},[579],{"type":18,"tag":81,"props":580,"children":582},{"alt":7,"src":581},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/e2515710dea84820ac3e8306ddc0b1a4.png",[],{"type":18,"tag":26,"props":584,"children":585},{},[586],{"type":24,"value":587},"After Jupyter is installed, enter a command on the terminal to start the JupyterLab backend. The IDE frontend is automatically displayed on the browser, and the JupyterLab programming environment is ready. (Enter the same command next time to open the IDE frontend.)",{"type":18,"tag":26,"props":589,"children":590},{},[591],{"type":24,"value":592},"jupyter-lab",{"type":18,"tag":26,"props":594,"children":595},{},[596],{"type":18,"tag":81,"props":597,"children":599},{"alt":7,"src":598},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/964abd0f37e54a32bc4ffe86326549a4.png",[],{"type":18,"tag":26,"props":601,"children":602},{},[603],{"type":24,"value":604},"Disable JupyterLab",{"type":18,"tag":26,"props":606,"children":607},{},[608],{"type":24,"value":609},"Open the terminal and press Ctrl+C to interrupt the Jupyter backend and end the process.",{"type":18,"tag":26,"props":611,"children":612},{},[613],{"type":18,"tag":81,"props":614,"children":616},{"alt":7,"src":615},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2024/10/25/943324b0283745f79be341ef9c1453f9.png",[],{"type":18,"tag":26,"props":618,"children":619},{},[620],{"type":18,"tag":30,"props":621,"children":622},{},[623],{"type":24,"value":624},"5.FAQ",{"type":18,"tag":26,"props":626,"children":627},{},[628,630,636,638,642],{"type":24,"value":629},"More sample code: ",{"type":18,"tag":45,"props":631,"children":634},{"href":632,"rel":633},"https://hiq.huaweicloud.com/tutorial/parameterized_quantum_circuit",[49],[635],{"type":24,"value":632},{"type":24,"value":637}," ",{"type":18,"tag":45,"props":639,"children":641},{"href":632,"rel":640},[49],[],{"type":24,"value":643},".",{"type":18,"tag":26,"props":645,"children":646},{},[647],{"type":24,"value":648},"HiQ Quantum Computing Cloud Platform FAQs:",{"type":18,"tag":26,"props":650,"children":651},{},[652],{"type":18,"tag":45,"props":653,"children":656},{"href":654,"rel":655},"https://www.hiascend.com/developer/blog/details/0215122546533946059",[49],[657],{"type":24,"value":654},{"title":7,"searchDepth":659,"depth":659,"links":660},4,[661,663],{"id":273,"depth":662,"text":279},3,{"id":371,"depth":664,"text":190},2,"markdown","content:technology-blogs:en:3440.md","content","technology-blogs/en/3440.md","technology-blogs/en/3440","md",1776506111352]