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
Copy file name to clipboardExpand all lines: docs/python/tutorial-working-with-python-in-visual-studio-step-05-installing-packages.md
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Python in Visual Studio tutorial step 5, install packages
3
3
titleSuffix: ""
4
-
description: Step 5 of a core walkthrough of Python capabilities in Visual Studio, demonstrating Visual Studio's features for managing packages in a Python environment.
4
+
description: Step 5 of a core walkthrough of Python capabilities in Visual Studio. Demonstrates Visual Studio features for managing packages in a Python environment.
5
5
ms.date: 02/09/2022
6
6
ms.topic: tutorial
7
7
author: rjmolyneaux
@@ -46,9 +46,9 @@ The Python developer community has produced thousands of useful packages that yo
2. Now, create a new project with **File** > **New** > **Project**, selecting the **Python Application** template.
49
+
1. Now, create a new project with **File** > **New** > **Project**, selecting the **Python Application** template.
50
50
51
-
3. In the code file that appears, paste the following code, which creates a cosine wave like the previous tutorial steps, only this time plotted graphically. You can also use the project you previously created and replace the code.
51
+
1. In the code file that appears, paste the following code, which creates a cosine wave like the previous tutorial steps, only this time plotted graphically. You can also use the project you previously created and replace the code.
52
52
53
53
```python
54
54
from math import radians
@@ -63,7 +63,7 @@ The Python developer community has produced thousands of useful packages that yo
63
63
main()
64
64
```
65
65
66
-
4. In the editor window, hover over the `numpy`and`matplotlib`import statements. You'll notice that they aren't resolved. To resolve the import statements, install the packages to the default global environment.
66
+
1. In the editor window, hover over the `numpy`and`matplotlib`import statements. You'll notice that they aren't resolved. To resolve the import statements, install the packages to the default global environment.
5. Looking at the editor window, you'll notice that if you hover over the `numpy` and `matplotlib` import statements that they aren't resolved. The reason is the packages haven't been installed to the default global environment.
75
+
1. Looking at the editor window, you'll notice that if you hover over the `numpy` and `matplotlib` import statements that they aren't resolved. The reason is the packages haven't been installed to the default global environment.
76
76
77
77
For example, select **Open interactive window**and an **Interactive window**for that specific environment appears in Visual Studio.
78
78
79
-
6. The **Packages** tab in the Python Environments window lists all packages that are currently installed in the environment.
79
+
1. The **Packages** tab in the Python Environments window lists all packages that are currently installed in the environment.
80
80
81
81
## Install packages using the Python Environments window
82
82
@@ -86,17 +86,17 @@ The Python developer community has produced thousands of useful packages that yo
86
86
[Install packages in an environment](media/environments/install-python-packages-2022.gif)
87
87
:::moniker-end
88
88
89
-
2. Install `matplotlib` by entering its name into the search field and then selecting the **Run command: pip install matplotlib** option. Running the command will install `matplotlib`, andany packages it depends on (in this case that includes `numpy`).
89
+
1. Install `matplotlib` by entering its name into the search field and then selecting the **Run command: pip install matplotlib** option. Running the command will install `matplotlib`, andany packages it depends on (in this case that includes `numpy`).
90
90
91
-
3. Choose the **Packages** tab.
91
+
1. Choose the **Packages** tab.
92
92
93
-
4. Consent to elevation if prompted to do so.
93
+
1. Consent to elevation if prompted to do so.
94
94
95
-
5. After the package is installed, it appears in the **Python Environments** window. The **X** to the right of the package uninstalls it.
95
+
1. After the package is installed, it appears in the **Python Environments** window. The **X** to the right of the package uninstalls it.
96
96
97
-
6. Enter `matplotlib` into the search field to install `matplotlib`.
97
+
1. Enter `matplotlib` into the search field to install `matplotlib`.
98
98
99
-
7. Select the **Run command: pip install matplotlib** option.
99
+
1. Select the **Run command: pip install matplotlib** option.
100
100
This option installs `matplotlib`, andany packages it depends on (in this case, that includes `numpy`).
101
101
102
102
:::moniker range="vs-2022"
@@ -106,9 +106,9 @@ The Python developer community has produced thousands of useful packages that yo
106
106

107
107
:::moniker-end
108
108
109
-
8. Consent to elevation if prompted to do so.
109
+
1. Consent to elevation if prompted to do so.
110
110
111
-
9. After the package installs, it appears in the **Python Environments** window. The **X** to the right of the package uninstalls it.
111
+
1. After the package installs, it appears in the **Python Environments** window. The **X** to the right of the package uninstalls it.
112
112
113
113
:::moniker range="vs-2022"
114
114

0 commit comments