Skip to content

Commit b87f636

Browse files
Merge pull request #229043 from shuaijunye/PythonInlineNote
Add note for Python inline installation
2 parents d43ec4a + c60193d commit b87f636

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

articles/synapse-analytics/spark/apache-spark-manage-session-packages.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ To specify session-scoped Python packages:
3838

3939
You can use the popular *%pip* and *%conda* commands to install additional third party libraries or your custom libraries during your Apache Spark notebook session. In this section, we use *%pip* commands to demonstrate several common scenarios.
4040

41-
### Install a third party package
41+
> [!NOTE]
42+
>
43+
> - We recommend to put the *%pip* and *%conda* commands at the first cell of your notebook if you want to install new libraries. The Python interpreter will be restarted after the session-level library being managed to bring the changes effective.
44+
> - These commands of managing Python libraries will be disabled when running pipeline jobs. If you want to install a package within a pipeline, you must leverage the library management capabilities at the pool level.
45+
> - Session-scoped Python libraries are automatically installed across both the driver and worker nodes.
46+
> - The following *%conda* commands are not supported: *create*, *clean*, *compare*, *activate*, *deactivate*, *run*, *package*.
47+
> - You can refer to [%pip commands](https://pip.pypa.io/en/stable/cli/) and [%conda commands](https://docs.conda.io/projects/conda/en/latest/commands.html) for the full list of commands.
48+
49+
#### Install a third party package
4250

4351
You can easily install a Python library from [PyPI](https://pypi.org/).
4452

@@ -64,7 +72,7 @@ alt.Chart(cars).mark_point().encode(
6472
).interactive()
6573
```
6674

67-
### Install a wheel package from storage account
75+
#### Install a wheel package from storage account
6876

6977
In order to install library from storage, you need to mount to your storage account by running following commands.
7078

@@ -84,7 +92,7 @@ And then, you can use the *%pip install* command to install the required wheel p
8492
%pip install /<<path to wheel file>>/<<wheel package name>>.whl
8593
```
8694

87-
### Install another version of built-in library
95+
#### Install another version of built-in library
8896

8997
You can use the following command to see what's the built-in version of certain package. We use *pandas* as an example
9098

@@ -108,25 +116,20 @@ You can use the following command to switch *pandas* to another version, let's s
108116
%pip install pandas==1.2.4
109117
```
110118

111-
### Uninstall a session-scoped library
119+
#### Uninstall a session-scoped library
112120

113121
If you want to uninstall a package, which installed on this notebook session, you may refer to following commands. However, you cannot uninstall the built-in packages.
114122

115123
```python
116124
%pip uninstall altair vega_datasets --yes
117125
```
118126

119-
### Using *%pip* command to install libraries from a *requirement.txt* file
127+
#### Using *%pip* command to install libraries from a *requirement.txt* file
120128

121129
```python
122130
%pip install -r /<<path to requirement file>>/requirements.txt
123131
```
124132

125-
> [!NOTE]
126-
>
127-
> - We recommend you to put the *%pip* and *%conda* commands at the beginning of your notebook if you want to install new libraries. The python interpreter will be restarted after the session-level library being managed to bring the changes effective.
128-
> - You can refer to this [%pip commands](https://pip.pypa.io/en/stable/cli/) and [%conda commands](https://docs.conda.io/projects/conda/en/latest/commands.html) for the full list of available commands.
129-
130133
## Session-scoped Java or Scala packages
131134

132135
To specify session-scoped Java or Scala packages, you can use the ```%%configure``` option:

0 commit comments

Comments
 (0)