<commit_before>---
layout: page
title: Windows Setup
action: Get Started
action_url: /get_started
permalink: /get_started/windows_setup
---
<!--- Licensed to the Apache Software Foundation (ASF) under one -->
<!--- or more contributor license agreements.  See the NOTICE file -->
<!--- distributed with this work for additional information -->
<!--- regarding copyright ownership.  The ASF licenses this file -->
<!--- to you under the Apache License, Version 2.0 (the -->
<!--- "License"); you may not use this file except in compliance -->
<!--- with the License.  You may obtain a copy of the License at -->

<!---   http://www.apache.org/licenses/LICENSE-2.0 -->

<!--- Unless required by applicable law or agreed to in writing, -->
<!--- software distributed under the License is distributed on an -->
<!--- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -->
<!--- KIND, either express or implied.  See the License for the -->
<!--- specific language governing permissions and limitations -->
<!--- under the License. -->

# Installing MXNet on Windows

The following describes how to install with pip for computers with CPUs, Intel CPUs, and NVIDIA GPUs. Further along in the document you can learn how to build MXNet from source on Windows, or how to install packages that support different language APIs to MXNet.

- [Prerequisites](#prerequisites)
- [Install MXNet with Python](#install-mxnet-with-python)
    - [Install with CPUs](#install-with-cpus)
    - [Install with Intel CPUs](#install-with-intel-cpus)
    - [Install with NVIDIA GPUs](#install-with-nvidia-gpus)
    - [Notes on the Python Packages](#notes-on-the-python-packages)
- [Build from Source](#build-from-source)
- Install MXNet with a Programming Language API
    - [Python](#install-the-mxnet-package-for-python)
    - [R](#install-the-mxnet-package-for-r)
    - [Julia](#install-the-mxnet-package-for-julia)


## Prerequisites

### Minimum System Requirements

* Windows 7<sup><a href="#fn1" id="ref1">1</a></sup>, 10, Server 2012 R2, or Server 2016
* Visual Studio 2015 or 2017 (any type)
* Python 2.7 or 3.6
* pip

<sup id="fn1">1. There are [known issues](https://github.com/apache/incubator-mxnet/issues?utf8=%E2%9C%93&q=is%3Aissue+windows7+label%3AWindows+) with Windows 7. <a href="#ref1" title="Return to source text.">↩</a></sup>

### Recommended System Requirements

* Windows 10, Server 2012 R2, or Server 2016
* Visual Studio 2017 (any type)
* At least one [NVIDIA CUDA-enabled GPU](https://developer.nvidia.com/cuda-gpus)
* MKL-enabled CPU: Intel® Xeon® processor, Intel® Core™ processor family, Intel Atom® processor, or Intel® Xeon Phi™ processor
* Python 2.7 or 3.6
* pip


## Install MXNet with Python

The easiest way to install MXNet on Windows is by using a [Python pip package](https://pip.pypa.io/en/stable/installing/).

**Note**: Windows pip packages typically release a few days after a new version MXNet is released. Make sure you verify which version gets installed.

### Install with CPUs

Install MXNet with CPU support with Python:

```bash
pip install mxnet
```

Now [validate your MXNet installation with Python](/get_started/validate_mxnet).

### Install with Intel CPUs

MXNet has experimental support for Intel [MKL](https://software.intel.com/en-us/mkl) and [MKL-DNN](https://github.com/intel/mkl-dnn). When using supported Intel hardware, inference and training can be vastly faster when using MXNet with [MKL](https://software.intel.com/en-us/mkl) or [MKL-DNN](https://github.com/intel/mkl-dnn).

The following steps will setup MXNet with MKL. MKL-DNN can be enabled only when building from source.
1. Download and install [Intel MKL](https://software.intel.com/en-us/mkl/choose-download/windows) (registration required).
1. Install MXNet with MKL support with Python:

```bash
pip install mxnet-mkl
```

Now [validate your MXNet installation with Python](/get_started/validate_mxnet).

### Install with NVIDIA GPUs

When using supported NVIDIA GPU hardware, inference and training can be vastly faster with [NVIDIA CUDA](https://developer.nvidia.com/cuda-toolkit) and [cuDNN](https://developer.nvidia.com/cudnn). You have two options for installing MXNet with CUDA support with a Python package.
- [Install with CUDA support](#install-with-cuda-support)
- [Install with CUDA and MKL support](#install-with-cuda-and-mkl-support)

#### Install with CUDA Support

The following steps will setup MXNet with CUDA. cuDNN can be enabled only when building from source.
1. Install [Microsoft Visual Studio 2017](https://www.visualstudio.com/downloads/) or [Microsoft Visual Studio 2015](https://www.visualstudio.com/vs/older-downloads/).
1. Download and install [NVIDIA CUDA](https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal). CUDA versions 9.2 or 9.0 are recommended. Some [issues with CUDA 9.1](https://github.com/apache/incubator-mxnet/labels/CUDA) have been identified in the past.
1. Download and install [NVIDIA_CUDA_DNN](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#install-windows)
1. Install MXNet with CUDA support with pip:

```bash
pip install mxnet-cu92
```

Once you have installed a version of MXNet, [validate your MXNet installation with Python](validate_mxnet).

#### Install with CUDA and MKL Support

You can also use a combination of CPU/GPU enhancements provided by Intel and NVIDIA.

The following steps will setup MXNet with CUDA and MKL.
1. Install [Microsoft Visual Studio 2017](https://www.visualstudio.com/downloads/) or [Microsoft Visual Studio 2015](https://www.visualstudio.com/vs/older-downloads/).
1. Download and install [Intel MKL](https://software.intel.com/en-us/mkl/choose-download/windows) (registration required).
1. Download and install [NVIDIA CUDA](https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal).
1. Download and install [NVIDIA_CUDA_DNN](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#install-windows)
1. Install MXNet with MKL support with pip:

```bash
pip install mxnet-cu92mkl
```

Once you have installed a version of MXNet, [validate your MXNet installation with Python](validate_mxnet).

### Notes on the Python Packages
To get further enhancements for deep neural networks, you may want to enable MKL-DNN and/or cuDNN. Each of these require you to [build from source](#build-from-source) and to enable the build flags for each.

Check the chart below for other options or refer to [PyPI for other MXNet pip packages](https://pypi.org/project/mxnet/).

![pip packages](https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/install/pip-packages.png)


## Build from Source

**IMPORTANT: It is recommended that you review the [build from source guide](build_from_source) first.** It describes many of the build options that come with MXNet in more detail. You may decide to install additional dependencies and modify your build flags after reviewing this material.

We provide two primary options to build and install MXNet yourself using [Microsoft Visual Studio 2017](https://www.visualstudio.com/downloads/) or [Microsoft Visual Studio 2015](https://www.visualstudio.com/vs/older-downloads/).

**NOTE:** Visual Studio 2017's compiler is `vc15`. This is not to be confused with Visual Studio 2015's compiler, `vc14`.

You also have the option to install MXNet with MKL or MKL-DNN. In this case it is recommended that you refer to the [MKLDNN_README](https://mxnet.apache.org/api/python/docs/tutorials/performance/backend/mkldnn/mkldnn_readme.html).

**Option 1: Build with Microsoft Visual Studio 2017 (VS2017)**

To build and install MXNet yourself using [VS2017](https://www.visualstudio.com/downloads/), you need the following dependencies. You may try a newer version of a particular dependency, but please open a pull request or [issue](https://github.com/apache/incubator-mxnet/issues/new) to update this guide if a newer version is validated.

1. Install or update VS2017.
    - If [VS2017](https://www.visualstudio.com/downloads/) is not already installed, download and install it. You can download and install the free community edition.
    - When prompted about installing Git, go ahead and install it.
    - If VS2017 is already installed you will want to update it. Proceed to the next step to modify your installation. You will be given the opportunity to update VS2017 as well
1. Follow the [instructions for opening the Visual Studio Installer](https://docs.microsoft.com/en-us/visualstudio/install/modify-visual-studio) to modify `Individual components`.
1. Once in the Visual Studio Installer application, update as needed, then look for and check `VC++ 2017 version 15.4 v14.11 toolset`, and click `Modify`.
1. Change the version of the Visual studio 2017 to v14.11 using the following command (by default the VS2017 is installed in the following path):
```
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.11<commit_msg>Update documentation with automated windows environment scripts<commit_after>---
layout: page
title: Windows Setup
action: Get Started
action_url: /get_started
permalink: /get_started/windows_setup
---
<!--- Licensed to the Apache Software Foundation (ASF) under one -->
<!--- or more contributor license agreements.  See the NOTICE file -->
<!--- distributed with this work for additional information -->
<!--- regarding copyright ownership.  The ASF licenses this file -->
<!--- to you under the Apache License, Version 2.0 (the -->
<!--- "License"); you may not use this file except in compliance -->
<!--- with the License.  You may obtain a copy of the License at -->

<!---   http://www.apache.org/licenses/LICENSE-2.0 -->

<!--- Unless required by applicable law or agreed to in writing, -->
<!--- software distributed under the License is distributed on an -->
<!--- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -->
<!--- KIND, either express or implied.  See the License for the -->
<!--- specific language governing permissions and limitations -->
<!--- under the License. -->

# Installing MXNet on Windows

The following describes how to install with pip for computers with CPUs, Intel CPUs, and NVIDIA GPUs. Further along in the document you can learn how to build MXNet from source on Windows, or how to install packages that support different language APIs to MXNet.

- [Prerequisites](#prerequisites)
- [Install MXNet with Python](#install-mxnet-with-python)
    - [Install with CPUs](#install-with-cpus)
    - [Install with Intel CPUs](#install-with-intel-cpus)
    - [Install with NVIDIA GPUs](#install-with-nvidia-gpus)
    - [Notes on the Python Packages](#notes-on-the-python-packages)
- [Build from Source](#build-from-source)
- Install MXNet with a Programming Language API
    - [Python](#install-the-mxnet-package-for-python)
    - [R](#install-the-mxnet-package-for-r)
    - [Julia](#install-the-mxnet-package-for-julia)


## Prerequisites

### Minimum System Requirements

* Windows 7<sup><a href="#fn1" id="ref1">1</a></sup>, 10, Server 2012 R2, or Server 2016
* Visual Studio 2015 or 2017 (any type)
* Python 2.7 or 3.6
* pip

<sup id="fn1">1. There are [known issues](https://github.com/apache/incubator-mxnet/issues?utf8=%E2%9C%93&q=is%3Aissue+windows7+label%3AWindows+) with Windows 7. <a href="#ref1" title="Return to source text.">↩</a></sup>

### Recommended System Requirements

* Windows 10, Server 2012 R2, or Server 2016
* Visual Studio 2017 (any type)
* At least one [NVIDIA CUDA-enabled GPU](https://developer.nvidia.com/cuda-gpus)
* MKL-enabled CPU: Intel® Xeon® processor, Intel® Core™ processor family, Intel Atom® processor, or Intel® Xeon Phi™ processor
* Python 2.7 or 3.6
* pip


## Install MXNet with Python

The easiest way to install MXNet on Windows is by using a [Python pip package](https://pip.pypa.io/en/stable/installing/).

**Note**: Windows pip packages typically release a few days after a new version MXNet is released. Make sure you verify which version gets installed.

### Install with CPUs

Install MXNet with CPU support with Python:

```bash
pip install mxnet
```

Now [validate your MXNet installation with Python](/get_started/validate_mxnet).

### Install with Intel CPUs

MXNet has experimental support for Intel [MKL](https://software.intel.com/en-us/mkl) and [MKL-DNN](https://github.com/intel/mkl-dnn). When using supported Intel hardware, inference and training can be vastly faster when using MXNet with [MKL](https://software.intel.com/en-us/mkl) or [MKL-DNN](https://github.com/intel/mkl-dnn).

The following steps will setup MXNet with MKL. MKL-DNN can be enabled only when building from source.
1. Download and install [Intel MKL](https://software.intel.com/en-us/mkl/choose-download/windows) (registration required).
1. Install MXNet with MKL support with Python:

```bash
pip install mxnet-mkl
```

Now [validate your MXNet installation with Python](/get_started/validate_mxnet).

### Install with NVIDIA GPUs

When using supported NVIDIA GPU hardware, inference and training can be vastly faster with [NVIDIA CUDA](https://developer.nvidia.com/cuda-toolkit) and [cuDNN](https://developer.nvidia.com/cudnn). You have two options for installing MXNet with CUDA support with a Python package.
- [Install with CUDA support](#install-with-cuda-support)
- [Install with CUDA and MKL support](#install-with-cuda-and-mkl-support)

#### Install with CUDA Support

The following steps will setup MXNet with CUDA. cuDNN can be enabled only when building from source.
1. Install [Microsoft Visual Studio 2017](https://www.visualstudio.com/downloads/) or [Microsoft Visual Studio 2015](https://www.visualstudio.com/vs/older-downloads/).
1. Download and install [NVIDIA CUDA](https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal). CUDA versions 9.2 or 9.0 are recommended. Some [issues with CUDA 9.1](https://github.com/apache/incubator-mxnet/labels/CUDA) have been identified in the past.
1. Download and install [NVIDIA_CUDA_DNN](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#install-windows)
1. Install MXNet with CUDA support with pip:

```bash
pip install mxnet-cu92
```

Once you have installed a version of MXNet, [validate your MXNet installation with Python](validate_mxnet).

#### Install with CUDA and MKL Support

You can also use a combination of CPU/GPU enhancements provided by Intel and NVIDIA.

The following steps will setup MXNet with CUDA and MKL.
1. Install [Microsoft Visual Studio 2017](https://www.visualstudio.com/downloads/) or [Microsoft Visual Studio 2015](https://www.visualstudio.com/vs/older-downloads/).
1. Download and install [Intel MKL](https://software.intel.com/en-us/mkl/choose-download/windows) (registration required).
1. Download and install [NVIDIA CUDA](https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal).
1. Download and install [NVIDIA_CUDA_DNN](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#install-windows)
1. Install MXNet with MKL support with pip:

```bash
pip install mxnet-cu92mkl
```

Once you have installed a version of MXNet, [validate your MXNet installation with Python](validate_mxnet).

### Notes on the Python Packages
To get further enhancements for deep neural networks, you may want to enable MKL-DNN and/or cuDNN. Each of these require you to [build from source](#build-from-source) and to enable the build flags for each.

Check the chart below for other options or refer to [PyPI for other MXNet pip packages](https://pypi.org/project/mxnet/).

![pip packages](https://raw.githubusercontent.com/dmlc/web-data/master/mxnet/install/pip-packages.png)


## Build from Source



### *NEW* Automated environment setup.

For automated setting up of developer environment in windows, use script bundle from the ![windows.zip](https://windows-post-install.s3-us-west-2.amazonaws.com/windows.zip)
file. Extract into a folder and execute the following command in a powershell console:

```
.\setup.ps1
```

This will install VS Community 2017, Python, and other dependencies needed to build in windows.
After that, follow the steps below starting from "build the MXNet source code" section.



### Manual installation.


**IMPORTANT: It is recommended that you review the [build from source guide](build_from_source) first.** It describes many of the build options that come with MXNet in more detail. You may decide to install additional dependencies and modify your build flags after reviewing this material.

We provide two primary options to build and install MXNet yourself using [Microsoft Visual Studio 2017](https://www.visualstudio.com/downloads/) or [Microsoft Visual Studio 2015](https://www.visualstudio.com/vs/older-downloads/).

**NOTE:** Visual Studio 2017's compiler is `vc15`. This is not to be confused with Visual Studio 2015's compiler, `vc14`.

You also have the option to install MXNet with MKL or MKL-DNN. In this case it is recommended that you refer to the [MKLDNN_README](https://mxnet.apache.org/api/python/docs/tutorials/performance/backend/mkldnn/mkldnn_readme.html).

**Option 1: Build with Microsoft Visual Studio 2017 (VS2017)**

To build and install MXNet yourself using [VS2017](https://www.visualstudio.com/downloads/), you need the following dependencies. You may try a newer version of a particular dependency, but please open a pull request or [issue](https://github.com/apache/incubator-mxnet/issues/new) to update this guide if a newer version is validated.

1. Install or update VS2017.
    - If [VS2017](https://www.visualstudio.com/downloads/) is not already installed, download and install it. You can download and install the free community edition.
    - When prompted about installing Git, go ahead and install it.
    - If VS2017 is already installed you will want to update it. Proceed to the next step to modify your installation. You will be given the opportunity to update VS2017 as well
1. Follow the [instructions for opening the Visual Studio Installer](https://docs.microsoft.com/en-us/visualstudio/install/modify-visual-studio) to modify `Individual components`.
1. Once in the Visual Studio Installer application, update as needed, then look for and check `VC++ 2017 version 15.4 v14.11 toolset`, and click `Modify`.
1. Change the version of the Visual studio 2017 to v14.11 using the following command (by default the VS2017 is installed in the following path):
```
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.11
{'fraction_non_alphanumeric': 0.10955536554082941, 'fraction_numerical': 0.021643864899529713, 'mean_word_length': 4.486074464966285, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 59, 'lorem ipsum': 0, 'www.': 18, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1559740', 'n_tokens_mistral': 5972, 'n_tokens_neox': 5332, 'n_words': 2078}