mindspore_cpu_win_install_en.md 4.5 KB
Newer Older
S
sunsuodong 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
# MindSpore Installation Guide on Windows

This document describes how to quickly install MindSpore on a Windows system with a CPU environment.

<!-- TOC -->

- [MindSpore Installation Guide on Windows](#mindspore-installation-guide-on-windows)
    - [Environment Requirements](#environment-requirements)
        - [System Requirements and Software Dependencies](#system-requirements-and-software-dependencies)
        - [(Optional) Installing Conda](#optional-installing-conda)
    - [Installation Guide](#installation-guide)
        - [Installing Using Executable Files](#installing-using-executable-files)
        - [Installing Using the Source Code](#installing-using-the-source-code)

<!-- /TOC -->

## Environment Requirements

### System Requirements and Software Dependencies

| Version | Operating System | Executable File Installation Dependencies | Source Code Compilation and Installation Dependencies |
| ---- | :--- | :--- | :--- |
昇思MindSpore's avatar
昇思MindSpore 已提交
23
| MindSpore master | Windows 10 x86_64 | - [Python](https://www.python.org/downloads/) 3.7.5 <br> - For details about other dependency items, see [requirements.txt](https://gitee.com/mindspore/mindspore/blob/r0.2/requirements.txt). | **Compilation dependencies:**<br> - [Python](https://www.python.org/downloads/) 3.7.5 <br> - [MinGW-W64 GCC-7.3.0](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) x86_64-posix-seh <br> - [ActivePerl](http://downloads.activestate.com/ActivePerl/releases/5.24.3.2404/ActivePerl-5.24.3.2404-MSWin32-x64-404865.exe) 5.24.3.2404 <br> - [CMake](https://cmake.org/download/) 3.14.1 <br> - [wheel](https://pypi.org/project/wheel/) >= 0.32.0 <br> **Installation dependencies:**<br> same as the executable file installation dependencies. |
S
sunsuodong 已提交
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

- When the network is connected, dependency items in the requirements.txt file are automatically downloaded during .whl package installation. In other cases, you need to manually install dependency items.

### (Optional) Installing Conda

1. Download the Conda installation package from the following path:

   - [X86 Anaconda](https://www.anaconda.com/distribution/) or [X86 Miniconda](https://docs.conda.io/en/latest/miniconda.html)

2. Open Anaconda Prompt from the Windows start menu after installation.
3. Create and activate the Python environment.

    ```bash
    conda create -n {your_env_name} python=3.7.5
    conda activate {your_env_name}
    ```

> Conda is a powerful Python environment management tool. It is recommended that a beginner read related information on the Internet first.

## Installation Guide

### Installing Using Executable Files

47
1. Download the .whl package the [MindSpore website](https://www.mindspore.cn/versions/en). It is recommended to perform SHA-256 integrity verification first and run the following command to install MindSpore:
S
sunsuodong 已提交
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

    ```bash
    pip install mindspore-{version}-cp37-cp37m-win_{arch}.whl
    ```

2. Run the following command. If no loading error message such as `No module named 'mindspore'` is displayed, the installation is successful.

    ```bash
    python
    import mindspore
    ```

### Installing Using the Source Code

1. Download the source code from the code repository.

    ```bash
昇思MindSpore's avatar
昇思MindSpore 已提交
65
    git clone https://gitee.com/mindspore/mindspore.git -b r0.2
S
sunsuodong 已提交
66 67 68 69 70 71 72 73 74
    ```

2. Run the following command in the root directory of the source code to compile MindSpore:

    ```bash
    call build.bat
    ```
    > - Before running the preceding command, ensure that the paths of mingw64\bin\ and the executable files cmake have been added to the environment variable PATH.
    > - In the build.sh script, the git clone command will be executed to obtain the code in the third-party dependency database. Ensure that the network settings of Git are correct.
C
chenjianping 已提交
75 76
    > - If the compiler performance is strong, you can add -j{Number of threads} in to script to increase the number of threads(Default 6). For example, `call build.bat 12`.
    > - Before running the preceding command, ensure that [Visual C ++ Redistributable for Visual Studio 2015](https://www.microsoft.com/zh-CN/download/details.aspx?id=48145) is installed.
S
sunsuodong 已提交
77 78 79 80 81 82 83 84 85 86 87 88 89

3. Run the following command to install MindSpore:

    ```bash
    pip install build/package/mindspore-{version}-cp37-cp37m-win_{arch}.whl
    ```

4. Run the following command. If no loading error message such as `No module named 'mindspore'` is displayed, the installation is successful.

    ```bash
    python
    import mindspore
    ```