|
| 1 | +--- |
| 2 | +title: Python installation in an offline Windows environment |
| 3 | +description: This tutorial shows how you can install Python in an offline Windows environment |
| 4 | +ms.topic: how-to |
| 5 | +ms.prod: azure-data-studio |
| 6 | +ms.technology: azure-data-studio |
| 7 | +author: lucyzhang929 |
| 8 | +ms.author: luczhan |
| 9 | +ms.reviewer: alayu, maghan |
| 10 | +ms.custom: "" |
| 11 | +ms.date: 07/02/2021 |
| 12 | +--- |
| 13 | + |
| 14 | +# Install Python in an offline Windows environment |
| 15 | + |
| 16 | +This tutorial demonstrates how to install and use the Python kernel in an offline Windows environment with notebooks. |
| 17 | + |
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +- [Azure Data Studio installed](../download-azure-data-studio.md) |
| 21 | + |
| 22 | +## Download Python and Dependencies |
| 23 | + |
| 24 | +1. On a machine that has internet access, download the latest Azure Data Studio Python package from here: [https://go.microsoft.com/fwlink/?linkid=2163338](https://go.microsoft.com/fwlink/?linkid=2163338). Unzip the file into a local directory (for example: C:\\azuredatastudio-python). |
| 25 | + >[!Note] |
| 26 | + >The latest Azure Data Studio Python version is 3.8.10. |
| 27 | +
|
| 28 | +2. In a terminal, navigate to the Python directory. |
| 29 | + |
| 30 | + ```cmd |
| 31 | + cd C:\azuredatastudio-python |
| 32 | + ``` |
| 33 | +
|
| 34 | +3. Create a text file named **requirements.txt** with the following contents. |
| 35 | +
|
| 36 | + ```txt |
| 37 | + pandas>=0.24.2 |
| 38 | + jupyter>=1.0.0 |
| 39 | + sparkmagic>=0.12.9 |
| 40 | + powershell-kernel>=0.1.3 |
| 41 | + ``` |
| 42 | +
|
| 43 | +4. Create a sub directory named **`wheelhouse`**. |
| 44 | +
|
| 45 | + ```cmd |
| 46 | + mkdir wheelhouse |
| 47 | + ``` |
| 48 | +
|
| 49 | +5. Run the following command to download the required dependencies to the sub directory. |
| 50 | +
|
| 51 | + ```cmd |
| 52 | + python.exe -m pip download -r requirements.txt -d wheelhouse |
| 53 | + ``` |
| 54 | +
|
| 55 | +## Install Python on a machine that doesn't have internet access |
| 56 | +
|
| 57 | +1. On a machine that doesn't have internet access, copy the Python folder from above to a local directory (for example: C:\\azuredatastudio-python). |
| 58 | +
|
| 59 | +2. In a terminal, navigate to the Python folder. |
| 60 | +
|
| 61 | + ```cmd |
| 62 | + cd C:\azuredatastudio-python |
| 63 | + ``` |
| 64 | +
|
| 65 | +3. Run the following to install the dependencies. |
| 66 | +
|
| 67 | + ```cmd |
| 68 | + python.exe -m pip install -r requirements.txt --no-index --find-links wheelhouse |
| 69 | + ``` |
| 70 | +
|
| 71 | +## Use the Python Installation in Azure Data Studio |
| 72 | +
|
| 73 | +1. Open Azure Data Studio |
| 74 | +2. From the Command Palette, search for Configure Python for Notebooks. |
| 75 | +3. In the Configure Python for Notebooks wizard, select *Use existing Python installation*, and browse to the installed Python location (for example: C:\\azuredatastudio-python). |
| 76 | +
|
| 77 | +Once the wizard is completed, open a new notebook and change the kernel to Python. |
| 78 | +
|
| 79 | +> [!Note] |
| 80 | +> The steps above can be repeated for any additional packages needed. |
0 commit comments