From 89b485c97fd21d5b66bdfe38783239b2221b0c4f Mon Sep 17 00:00:00 2001 From: Martin Regen Date: Wed, 19 Oct 2016 08:08:39 +0200 Subject: [PATCH 1/2] Update Python setup instructions for Windows to use PyPI and the pip installer --- doc/get_started/python-devbox-setup.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/get_started/python-devbox-setup.md b/doc/get_started/python-devbox-setup.md index d20946ff33c..46199a340e5 100644 --- a/doc/get_started/python-devbox-setup.md +++ b/doc/get_started/python-devbox-setup.md @@ -4,6 +4,7 @@ This document describes how to prepare your development environment to use the * - [Setup your development environment](#devenv) - [Build the samples on Linux](#linux) +- [Install on Windows using PyPI wheels](#windows-wheels) - [Build the samples on Windows using nuget packages](#windows) - [Build the samples on Windows using cmake and boost libraries](#windows-cmake) - [Sample applications](#samplecode) @@ -40,6 +41,16 @@ The Python iothub_client supports python versions 2.7.x, 3.4.x or 3.5.x. Know th 1. On some small footprint Linux devices, like a *Raspberry Pi* using Raspbian OS, the following build error may occur: `virtual memory exhausted: Cannot allocate memory`. In such a case please try to increase the swap file size on your platform and retry the build. (If swap increase did not work consider running build.sh using --skip-unittests --use-websockets parameters) 2. CentOS7: Only Python 2.7 is supported due to a missing boost-python3 library package + +## Install the Python iothub_client module on Windows from [PyPI] + +The following instructions outline how you can install the libraries in Windows from [PyPi]: + +1. Open a command prompt and start the Python interpreter. +2. Install the iothub_client module with the following command: `pip install iothub-client` +3. Now Python is ready to run the sample applications. +Please follow instructions in [Sample applications](#samplecode) to run the Python samples. + ## Build the Python iothub_client module on Windows using Nuget packages (recommended) @@ -84,6 +95,7 @@ To use the iothub_client extension for native code debugging with [Python Tools This repository contains various Python sample applications that illustrate how to use the Microsoft Azure IoT SDK for Python. To learn how to run a sample application that sends messages to an IoT hub, see [Getting started - running a Python sample application][getstarted]. [python-2.7 or python-3.5]: https://www.python.org/downloads/ +[PyPI]: https://pypi.python.org/pypi/iothub-client/ [Python Tools for Visual Studio]: https://www.visualstudio.com/en-us/features/python-vs.aspx [setup-devbox]: https://github.com/Azure/azure-iot-sdks/blob/master/c/doc/devbox_setup.md [getstarted]: python-run-sample.md From ebee9b9665e6c55b5f2c13148b98729ae389f4b2 Mon Sep 17 00:00:00 2001 From: Dominic Betts Date: Fri, 21 Oct 2016 14:26:25 +0100 Subject: [PATCH 2/2] Expand Pip instructions --- doc/get_started/python-devbox-setup.md | 13 +++++++++---- doc/get_started/python-run-sample.md | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/get_started/python-devbox-setup.md b/doc/get_started/python-devbox-setup.md index 46199a340e5..60c9fb19675 100644 --- a/doc/get_started/python-devbox-setup.md +++ b/doc/get_started/python-devbox-setup.md @@ -44,13 +44,17 @@ The Python iothub_client supports python versions 2.7.x, 3.4.x or 3.5.x. Know th ## Install the Python iothub_client module on Windows from [PyPI] -The following instructions outline how you can install the libraries in Windows from [PyPi]: +The following instructions outline how you can install the **iothub\_client** module in Windows from [PyPi] using the **iothub\_client** package: -1. Open a command prompt and start the Python interpreter. -2. Install the iothub_client module with the following command: `pip install iothub-client` +1. Open a command-prompt window. +2. Install the **iothub\_client** package with the following command: `pip install iothub-client` 3. Now Python is ready to run the sample applications. Please follow instructions in [Sample applications](#samplecode) to run the Python samples. +> Note: If it is not already installed, you need to install the [Visual C++ Redistributable for Visual Studio 2015][lnk-c-redist]. + +> Note: If Pip cannot install the package for the specific version of Python installed on your machine, use one of the following options to build the **iothub_client** module. + ## Build the Python iothub_client module on Windows using Nuget packages (recommended) @@ -58,7 +62,7 @@ The following instructions outline how you can build the libraries in Windows: 1. Open a Visual Studio 2015 x86 Native Tools command prompt and navigate to the folder **python/build_all/windows** in your local copy of the repository. 2. Run the script `build.cmd` in the **python\\build_all\\windows** directory. -3. As a result, the `iothub_client.pyd` Python extension module is copied to the **python/device/samples** folder. Please follow instructions in [Sample applications](#samplecode) to run the Python samples. +3. As a result, the `iothub_client.pyd` Python extension module is copied to the **python/device/samples** folder. Follow the instructions in [Sample applications](#samplecode) to run the Python IoT Hub samples. 4. In order to run the samples with a different Python version (e.g. 32bit vs. 64bit or 2.7 vs. 3.4) please rebuild the `iothub_client.pyd` extension. @@ -100,3 +104,4 @@ This repository contains various Python sample applications that illustrate how [setup-devbox]: https://github.com/Azure/azure-iot-sdks/blob/master/c/doc/devbox_setup.md [getstarted]: python-run-sample.md [boost-zip]: http://www.boost.org/users/history/version_1_60_0.html +[lnk-c-redist]: https://www.microsoft.com/download/details.aspx?id=48145 \ No newline at end of file diff --git a/doc/get_started/python-run-sample.md b/doc/get_started/python-run-sample.md index 0710edcdbae..f03d871021d 100644 --- a/doc/get_started/python-run-sample.md +++ b/doc/get_started/python-run-sample.md @@ -40,6 +40,8 @@ You should have the following items ready before beginning the process: - Make sure desktop is ready as per instructions given on [Prepare your development environment][lnk-python-devbox-setup]. +> Note: On Windows, you can install the **iothub-client** module package using Pip as described in [Prepare your development environment][lnk-python-devbox-setup]. + # Step 3: Run the sample