[英]cannot import name 'TypeGuard' from 'typing_extensions'
I am new to Python and found the following error with swmmtoolbox package.我是 Python 新手,发现 swmmtoolbox 包出现以下错误。 I would really appreciate your comments.
我非常感谢您的评论。 Thanks
谢谢
Traceback (most recent call last):回溯(最近一次通话最后):
File "C:\Users\Hydraulic Group\anaconda3\lib\site-packages\typic\compat.py", line 16, in <module>
from typing import Final, TypedDict, Literal, Protocol, **TypeGuard**, get_origin, get_args # type: ignore
ImportError: cannot import name 'TypeGuard' from 'typing' (C:\Users\Hydraulic Group\anaconda3\lib\typing.py)
During handling of the above exception, another exception occurred: Traceback (most recent call last):在处理上述异常的过程中,又出现了一个异常:Traceback(最近一次调用last):
File "E:\VARS_Research\ostrich_swmm_master\ostrich_swmm\__main__.py", line 11, in <module>
import extract
File "E:\VARS_Research\ostrich_swmm_master\ostrich_swmm\extract.py", line 8, in <module>
import swmmtoolbox.swmmtoolbox as swmmtoolbox
File "C:\Users\Hydraulic Group\anaconda3\lib\site-packages\swmmtoolbox\swmmtoolbox.py", line 19, in <module>
from tstoolbox import tsutils
File "C:\Users\Hydraulic Group\anaconda3\lib\site-packages\tstoolbox\tsutils.py", line 24, in <module>
import typic
File "C:\Users\Hydraulic Group\anaconda3\lib\site-packages\typic\__init__.py", line 4, in <module>
from . import types, constraints
File "C:\Users\Hydraulic Group\anaconda3\lib\site-packages\typic\types\__init__.py", line 6, in <module>
from .dsn import *
File "C:\Users\Hydraulic Group\anaconda3\lib\site-packages\typic\types\dsn.py", line 8, in <module>
from typic.util import cached_property, slotted
File "C:\Users\Hydraulic Group\anaconda3\lib\site-packages\typic\util.py", line 41, in <module>
import typic.checks as checks
File "C:\Users\Hydraulic Group\anaconda3\lib\site-packages\typic\checks.py", line 36, in <module>
from typic.compat import (
File "C:\Users\Hydraulic Group\anaconda3\lib\site-packages\typic\compat.py", line 18, in <module>
from typing_extensions import Final, TypedDict, Literal, TypeGuard, Protocol, get_origin, get_args # type: ignore
ImportError: cannot import name 'TypeGuard' from 'typing_extensions' (C:\Users\Hydraulic Group\anaconda3\lib\site-packages\typing_extensions.py)s about this issue.
有完全相同的问题,升级打字扩展对我有用:
pip install typing-extensions --upgrade
I got this error when I pip installed panel and hvplot in my conda environment.当我在我的 conda 环境中 pip 安装面板和 hvplot 时出现此错误。 The previous replies didn't work for me, but reinstalling hvplot directly through conda worked like a charm!
以前的回复对我不起作用,但是直接通过 conda 重新安装 hvplot 就像一个魅力!
conda install -c pyviz hvplot
Reference: https://hvplot.holoviz.org/index.html#installation参考: https ://hvplot.holoviz.org/index.html#installation
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.