Skip to content

Commit d871011

Browse files
authored
Discuss dependency on aiohttp package (#33826)
1 parent 2344c14 commit d871011

File tree

3 files changed

+33
-24
lines changed

3 files changed

+33
-24
lines changed

sdk/vision/azure-ai-vision-imageanalysis/README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,16 @@ client = ImageAnalysisClient(
7171

7272
<!-- END SNIPPET -->
7373

74-
A synchronous client supports synchronous analysis methods, meaning they will block until the service responds with analysis results. The code snippets below all use synchronous methods because it's easier for a getting-started guide. The SDK offers equivalent asynchronous APIs which are often preferred. To create an asynchronous client, simply update the above code to import `ImageAnalysisClient` from the `aio` namespace:
75-
76-
```python
77-
from azure.ai.vision.imageanalysis.aio import ImageAnalysisClient
78-
```
74+
A synchronous client supports synchronous analysis methods, meaning they will block until the service responds with analysis results. The code snippets below all use synchronous methods because it's easier for a getting-started guide. The SDK offers equivalent asynchronous APIs which are often preferred. To create an asynchronous client, do the following:
75+
76+
* Update the above code to import `ImageAnalysisClient` from the `aio` namespace:
77+
```python
78+
from azure.ai.vision.imageanalysis.aio import ImageAnalysisClient
79+
```
80+
* Install the additional package [aiohttp](https://pypi.org/project/aiohttp/):
81+
```bash
82+
pip install aiohttp
83+
```
7984

8085
## Key concepts
8186

sdk/vision/azure-ai-vision-imageanalysis/samples/README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@ See [Prerequisites](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/
3737

3838
## Setup
3939

40-
1. Clone or download this sample repository
41-
1. Open a command prompt / terminal window in this samples folder
42-
1. Install the Image Analysis client library for Python with pip:
43-
44-
```bash
45-
pip install azure-ai-vision-imageanalysis
46-
```
40+
* Clone or download this sample repository
41+
* Open a command prompt / terminal window in this samples folder
42+
* Install the Image Analysis client library for Python with pip:
43+
```bash
44+
pip install azure-ai-vision-imageanalysis
45+
```
46+
* If you plan to run the asynchronous client samples, insall the additional package [aiohttp](https://pypi.org/project/aiohttp/):
47+
```bash
48+
pip install aiohttp
49+
```
4750

4851
## Set environment variables
4952

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
# A PowerShell script to run all Python samples in the folder, one after the other.
2+
$python = if ($env:OS -eq "Windows_NT") { "python" } else { "python3" }
23

34
Write-Host "===> sample_analyze_all_image_file.py"
4-
Start-Process -NoNewWindow -Wait python sample_analyze_all_image_file.py
5+
Start-Process -NoNewWindow -Wait $python sample_analyze_all_image_file.py
56

67
Write-Host "===> sample_caption_image_file.py"
7-
Start-Process -NoNewWindow -Wait python sample_caption_image_file.py
8+
Start-Process -NoNewWindow -Wait $python sample_caption_image_file.py
89

910
Write-Host "===> sample_caption_image_file_async.py"
10-
Start-Process -NoNewWindow -Wait python async_samples/sample_caption_image_file_async.py
11+
Start-Process -NoNewWindow -Wait $python async_samples/sample_caption_image_file_async.py
1112

1213
Write-Host "===> sample_caption_image_url.py"
13-
Start-Process -NoNewWindow -Wait python sample_caption_image_url.py
14+
Start-Process -NoNewWindow -Wait $python sample_caption_image_url.py
1415

1516
Write-Host "===> sample_dense_captions_image_file.py"
16-
Start-Process -NoNewWindow -Wait python sample_dense_captions_image_file.py
17+
Start-Process -NoNewWindow -Wait $python sample_dense_captions_image_file.py
1718

1819
Write-Host "===> sample_objects_image_file.py"
19-
Start-Process -NoNewWindow -Wait python sample_objects_image_file.py
20+
Start-Process -NoNewWindow -Wait $python sample_objects_image_file.py
2021

2122
Write-Host "===> sample_ocr_image_file.py"
22-
Start-Process -NoNewWindow -Wait python sample_ocr_image_file.py
23+
Start-Process -NoNewWindow -Wait $python sample_ocr_image_file.py
2324

2425
Write-Host "===> sample_ocr_image_url.py"
25-
Start-Process -NoNewWindow -Wait python sample_ocr_image_url.py
26+
Start-Process -NoNewWindow -Wait $python sample_ocr_image_url.py
2627

2728
Write-Host "===> sample_ocr_image_url_async.py"
28-
Start-Process -NoNewWindow -Wait python async_samples/sample_ocr_image_url_async.py
29+
Start-Process -NoNewWindow -Wait $python async_samples/sample_ocr_image_url_async.py
2930

3031
Write-Host "===> sample_people_image_file.py"
31-
Start-Process -NoNewWindow -Wait python sample_people_image_file.py
32+
Start-Process -NoNewWindow -Wait $python sample_people_image_file.py
3233

3334
Write-Host "===> sample_smart_crops_image_file.py"
34-
Start-Process -NoNewWindow -Wait python sample_smart_crops_image_file.py
35+
Start-Process -NoNewWindow -Wait $python sample_smart_crops_image_file.py
3536

3637
Write-Host "===> sample_tags_image_file.py"
37-
Start-Process -NoNewWindow -Wait python sample_tags_image_file.py
38+
Start-Process -NoNewWindow -Wait $python sample_tags_image_file.py

0 commit comments

Comments
 (0)