cannot import name 'SerializationError' from 'azure.core.exceptions'

Vahan Alaverdyan 5 Reputation points
2023-04-26T09:46:22.16+00:00

I have a problem , when i can list Webjob list with python script

Traceback (most recent call last):
  File "az-get-jobs.py", line 2, in <module>
    from azure.mgmt.web import WebSiteManagementClient
  File "/usr/lib/python3/dist-packages/azure/mgmt/web/__init__.py", line 12, in <module>
    from ._configuration import WebSiteManagementClientConfiguration
  File "/usr/lib/python3/dist-packages/azure/mgmt/web/_configuration.py", line 11, in <module>
    from msrestazure import AzureConfiguration
  File "/usr/lib/python3/dist-packages/msrestazure/__init__.py", line 28, in <module>
    from .azure_configuration import AzureConfiguration
  File "/usr/lib/python3/dist-packages/msrestazure/azure_configuration.py", line 34, in <module>
    from msrest import Configuration
  File "/home/vahan/.local/lib/python3.8/site-packages/msrest/__init__.py", line 28, in <module>
    from .configuration import Configuration
  File "/home/vahan/.local/lib/python3.8/site-packages/msrest/configuration.py", line 38, in <module>
    from .universal_http.requests import (
  File "/home/vahan/.local/lib/python3.8/site-packages/msrest/universal_http/__init__.py", line 53, in <module>
    from ..exceptions import ClientRequestError, raise_with_traceback
  File "/home/vahan/.local/lib/python3.8/site-packages/msrest/exceptions.py", line 31, in <module>
    from azure.core.exceptions import SerializationError, DeserializationError
ImportError: cannot import name 'SerializationError' from 'azure.core.exceptions' (/usr/lib/python3/dist-packages/azure/core/exceptions.py)
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,934 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 14,065 Reputation points MVP
    2023-04-28T13:20:51.3+00:00

    Install the latest version of the azure-mgmt-web and azure-core

    pip install --upgrade azure-mgmt-web
    pip install --upgrade azure-core
    
    

    If the issue still persists, try creating a virtual environment to isolate the dependencies for your project. This will help you avoid conflicts with system-wide installed packages.

    python -m venv my_project_venv
    source my_project_venv/bin/activate  # For Linux and macOS
    my_project_venv\Scripts\activate     # For Windows
    
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.