Skip to content

Commit 5eb47e7

Browse files
authored
Merge pull request #19671 from markingmyname/python
[Azure Data Studio] New Python notebook article
2 parents 619d946 + 5fafb39 commit 5eb47e7

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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.

docs/azure-data-studio/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120
href: notebooks/notebooks-sql-kernel.md
121121
- name: Use Python Kernel
122122
href: notebooks/notebooks-python-kernel.md
123+
- name: Use Python Kernel Offline
124+
href: notebooks/notebooks-python-offline-installation.md
123125
- name: Use Kusto Kernel
124126
href: notebooks/notebooks-kusto-kernel.md
125127
- name: Use Kqlmagic

0 commit comments

Comments
 (0)