You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -17,72 +17,77 @@ This article describes how to import, manage, and use Python 3 packages in Azure
17
17
18
18
For information on managing Python 2 packages, see [Manage Python 2 packages](./python-packages.md).
19
19
20
+
21
+
> [!NOTE]
22
+
> [Python 2.7](https://devguide.python.org/versions/) and [Python 3.8](https://devguide.python.org/versions/) are no longer supported by parent platform Python. We recommend that you create runbooks in Python 3.10 only.
23
+
20
24
## Default Python packages
21
25
22
26
To support Python 3.8 runbooks in the Automation service, some Python packages are installed by default and a [list of these packages are here](default-python-packages.md). The default version can be overridden by importing Python packages into your Automation account.
23
27
24
28
Preference is given to the imported version in your Automation account. To import a single package, see [Import a package](#import-a-package). To import a package with multiple packages, see [Import a package with dependencies](#import-a-package-with-dependencies).
25
29
26
30
> [!NOTE]
27
-
> There are no default packages installed for Python 3.10 (preview).
31
+
> There are no default packages installed for Python 3.10.
28
32
29
33
## Packages as source files
30
34
31
35
Azure Automation supports only a Python package that only contains Python code and doesn't include other language extensions or code in other languages. However, the Azure Sandbox environment might not have the required compilers for C/C++ binaries, so it's recommended to use [wheel files](https://pythonwheels.com/) instead.
32
36
33
37
> [!NOTE]
34
-
> Currently, Python 3.10 (preview) only supports wheel files.
38
+
> Currently, Python 3.10 only supports wheel files.
35
39
36
40
The [Python Package Index](https://pypi.org/) (PyPI) is a repository of software for the Python programming language. When selecting a Python 3 package to import into your Automation account from PyPI, note the following filename parts:
37
41
38
42
Select a Python version:
39
43
40
-
#### [Python 3.8(GA)](#tab/py3)
44
+
#### [Python 3.10](#tab/py10)
41
45
42
46
| Filename part | Description |
43
47
|---|---|
44
-
|cp38|Automation supports **Python 3.8** for Cloud jobs.|
45
-
|amd64|Azure sandbox processes are **Windows 64-bit** architecture.|
48
+
|cp310|Automation supports **Python 3.10** for Cloud jobs.|
49
+
|manylinux_x86_64|Azure sandbox processes are Linux based 64-bit architecture for Python 3.10 runbooks.
46
50
47
-
For example:
48
-
- To import pandas - select a wheel file with a name similar as `pandas-1.2.3-cp38-win_amd64.whl`.
51
+
For example:
52
+
- To import pandas - select a wheel file with a name similar as `pandas-1.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl`
49
53
50
-
Some Python packages available on PyPI don't provide a wheel file. In this case, download the source (.zip or .tar.gz file) and generate the wheel file using `pip`.
54
+
Some Python packages available on PyPI don't provide a wheel file. In this case, download the source (.zip or .tar.gz file) and generate the wheel file using pip.
51
55
52
-
Perform the following steps using a 64-bit Windows machine with Python 3.8.x and wheel package installed:
56
+
Perform the following steps using a 64-bit Linux machine with Python 3.10.x and wheel package installed:
53
57
54
-
1.Download the source file `pandas-1.2.4.tar.gz`.
58
+
1.Download the source file `pandas-1.2.4.tar.gz.`
55
59
1. Run pip to get the wheel file with the following command: `pip wheel --no-deps pandas-1.2.4.tar.gz`
56
60
57
-
#### [Python 3.10 (preview)](#tab/py10)
61
+
#### [Python 3.8](#tab/py3)
58
62
59
63
| Filename part | Description |
60
64
|---|---|
61
-
|cp310|Automation supports **Python 3.10 (preview)** for Cloud jobs.|
62
-
|manylinux_x86_64|Azure sandbox processes are Linux based 64-bit architecture for Python 3.10 (preview) runbooks.
65
+
|cp38|Automation supports **Python 3.8** for Cloud jobs.|
66
+
|amd64|Azure sandbox processes are **Windows 64-bit** architecture.|
63
67
64
-
For example:
65
-
- To import pandas - select a wheel file with a name similar as `pandas-1.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl`
68
+
For example:
69
+
- To import pandas - select a wheel file with a name similar as `pandas-1.2.3-cp38-win_amd64.whl`.
66
70
67
-
Some Python packages available on PyPI don't provide a wheel file. In this case, download the source (.zip or .tar.gz file) and generate the wheel file using pip.
71
+
Some Python packages available on PyPI don't provide a wheel file. In this case, download the source (.zip or .tar.gz file) and generate the wheel file using `pip`.
68
72
69
-
Perform the following steps using a 64-bit Linux machine with Python 3.10.x and wheel package installed:
73
+
Perform the following steps using a 64-bit Windows machine with Python 3.8.x and wheel package installed:
70
74
71
-
1.Download the source file `pandas-1.2.4.tar.gz.`
75
+
1.Download the source file `pandas-1.2.4.tar.gz`.
72
76
1. Run pip to get the wheel file with the following command: `pip wheel --no-deps pandas-1.2.4.tar.gz`
73
77
74
78
---
75
79
76
80
## Import a package
77
81
82
+
To import a package, follow these steps:
83
+
78
84
1. In your Automation account, select **Python packages** under **Shared Resources**. Then select **+ Add a Python package**.
79
85
80
86
:::image type="content" source="media/python-3-packages/add-python-3-package.png" alt-text="Screenshot of the Python packages page shows Python packages in the left menu and Add a Python package highlighted.":::
81
87
82
-
1. On the **Add Python Package** page, select a local package to upload. The package can be **.whl** or **.tar.gz** file for Python 3.8 and **.whl** file for Python 3.10 (preview).
83
-
1. Enter a name and select the **Runtime Version** as Python 3.8 or Python 3.10 (preview).
84
-
> [!NOTE]
85
-
> Currently, Python 3.10 (preview) runtime version is supported for both Cloud and Hybrid jobs in all Public regions except Australia Central2, Korea South, Sweden South, Jio India Central, Brazil Southeast, Central India, West India, UAE Central, and Gov clouds.
88
+
1. On the **Add Python Package** page, select a local package to upload. The package can be **.whl** or **.tar.gz** file for Python 3.8 and **.whl** file for Python 3.10.
89
+
1. Enter a name and select the **Runtime Version** as Python 3.8 or Python 3.10.
90
+
86
91
1. Select **Import**.
87
92
88
93
:::image type="content" source="media/python-3-packages/upload-package.png" alt-text="Screenshot shows the Add Python 3.8 Package page with an uploaded tar.gz file selected.":::
@@ -213,18 +218,16 @@ if __name__ == '__main__':
213
218
```
214
219
---
215
220
216
-
#### Importing the script into a runbook
221
+
#### Import the script into a runbook
217
222
For information on importing the runbook, see [Import a runbook from the Azure portal](manage-runbooks.md#import-a-runbook-from-the-azure-portal). Copy the file from GitHub to storage that the portal can access before you run the import.
218
223
219
-
> [!NOTE]
220
-
> Currently, importing a runbook from Azure Portal isn't supported for Python 3.10 (preview).
221
224
222
225
223
226
The **Import a runbook** page defaults the runbook name to match the name of the script. If you have access to the field, you can change the name. **Runbook type** may default to **Python 2.7**. If it does, make sure to change it to **Python 3.8**.
#### Executing the runbook to import the package and dependencies
230
+
#### Execute the runbook to import the package and dependencies
228
231
229
232
After creating and publishing the runbook, run it to import the package. See [Start a runbook in Azure Automation](start-runbooks.md) for details on executing the runbook.
0 commit comments