Hi Saiu Luminita,
Thanks for sharing error details. You are encountering this error:
ImportError: cannot import name 'PollingReturnType' from 'azure.core.polling._poller'
This typically indicates a version mismatch between your azure-ai-textanalytics package and the azure-core package, where azure-ai-textanalytics expects a certain version of azure-core that includes PollingReturnType, but your current azure-core version doesn't have it.
To fix this issue:
1.Check current versions: Run this in your terminal:
pip show azure-ai-textanalytics azure-core
2.Upgrade both packages to compatible versions: Use the following command to upgrade to compatible versions:
pip install --upgrade azure-ai-textanalytics azure-core
As of the latest stable release:
· azure-ai-textanalytics should be v5.3.0 or newer
· azure-core should be v1.26.0 or newer
3.Verify your environment is clean: If you're using a global Python installation, it might be better to use a virtual environment to avoid conflicting packages:
python -m venv myenv
myenv\Scripts\activate
pip install azure-ai-textanalytics
This happens because:
The PollingReturnType class was introduced in a newer version of azure-core. If you're using an older version of azure-core, it won't have that class, and azure-ai-textanalytics which expects it will fail to import it.
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.
Thank you!