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
The error ImportError: cannot import name 'Url' from 'pydantic.networks' (/usr/local/lib/python3.12/site-packages/pydantic/networks.py) is caused by from semantic_kernel import Kernel with pydantic==2.10.0.
This did not happen yesterday, with no changes to the code. It appears to be caused by pydantic version 2.10.0, which was released on 2024-11-20. This was noticed when building a Docker image that did not specify a pydantic version, and therefore used the latest one as a dependency to semantic-kernel.
No errors on from semantic_kernel import Kernel as long as the semantic-kernel package is installed.
Screenshots
Stack trace:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/app/my_module/processes/my_process/localruntime.py", line 11, in <module>
from semantic_kernel import Kernel
File "/usr/local/lib/python3.12/site-packages/semantic_kernel/__init__.py", line 3, in <module>
from semantic_kernel.kernel import Kernel
File "/usr/local/lib/python3.12/site-packages/semantic_kernel/kernel.py", line 8, in <module>
from semantic_kernel.connectors.ai.embeddings.embedding_generator_base import EmbeddingGeneratorBase
File "/usr/local/lib/python3.12/site-packages/semantic_kernel/connectors/ai/__init__.py", line 3, in <module>
from semantic_kernel.connectors.ai.prompt_execution_settings import PromptExecutionSettings
File "/usr/local/lib/python3.12/site-packages/semantic_kernel/connectors/ai/prompt_execution_settings.py", line 8, in <module>
from semantic_kernel.connectors.ai.function_choice_behavior import FunctionChoiceBehavior
File "/usr/local/lib/python3.12/site-packages/semantic_kernel/connectors/ai/function_choice_behavior.py", line 10, in <module>
from semantic_kernel.connectors.ai.function_calling_utils import _combine_filter_dicts
File "/usr/local/lib/python3.12/site-packages/semantic_kernel/connectors/ai/function_calling_utils.py", line 6, in <module>
from semantic_kernel.contents.chat_message_content import ChatMessageContent
File "/usr/local/lib/python3.12/site-packages/semantic_kernel/contents/__init__.py", line 3, in <module>
from semantic_kernel.contents.annotation_content import AnnotationContent
File "/usr/local/lib/python3.12/site-packages/semantic_kernel/contents/annotation_content.py", line 10, in <module>
from semantic_kernel.contents.kernel_content import KernelContent
File "/usr/local/lib/python3.12/site-packages/semantic_kernel/contents/kernel_content.py", line 8, in <module>
from semantic_kernel.kernel_pydantic import KernelBaseModel
File "/usr/local/lib/python3.12/site-packages/semantic_kernel/kernel_pydantic.py", line 7, in <module>
from pydantic.networks import Url
ImportError: cannot import name 'Url' from 'pydantic.networks' (/usr/local/lib/python3.12/site-packages/pydantic/networks.py)
Platform
OS: Windows
IDE: gVim + PowerShell
Language: Python
Source: pip package version 1.15.0
Additional context
(none)
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Bug: ImportError: cannot import name 'Url' from 'pydantic.networks' since pydantic 2.10.0 release
Python: Bug: ImportError: cannot import name 'Url' from 'pydantic.networks' since pydantic 2.10.0 release
Nov 21, 2024
github-actionsbot
changed the title
Python: Bug: ImportError: cannot import name 'Url' from 'pydantic.networks' since pydantic 2.10.0 release
.Net: Bug: ImportError: cannot import name 'Url' from 'pydantic.networks' since pydantic 2.10.0 release
Nov 21, 2024
Druid-of-Luhn
changed the title
.Net: Bug: ImportError: cannot import name 'Url' from 'pydantic.networks' since pydantic 2.10.0 release
Python: Bug: ImportError: cannot import name 'Url' from 'pydantic.networks' since pydantic 2.10.0 release
Nov 21, 2024
Describe the bug
The error
ImportError: cannot import name 'Url' from 'pydantic.networks' (/usr/local/lib/python3.12/site-packages/pydantic/networks.py)
is caused byfrom semantic_kernel import Kernel
with pydantic==2.10.0.This did not happen yesterday, with no changes to the code. It appears to be caused by pydantic version 2.10.0, which was released on 2024-11-20. This was noticed when building a Docker image that did not specify a pydantic version, and therefore used the latest one as a dependency to semantic-kernel.
Forcing pydantic==2.9.2 resolves the issue.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No errors on
from semantic_kernel import Kernel
as long as thesemantic-kernel
package is installed.Screenshots
Stack trace:
Platform
Additional context
(none)
The text was updated successfully, but these errors were encountered: