简体   繁体   English

无法从“typing_extensions”导入名称“TypeGuard”

[英]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.

相关问题 Python Django ImportError:无法从“typing_extensions”导入名称“Required” - Python Django ImportError: cannot import name 'Required' from 'typing_extensions' 我可以使用来自 typing_extensions 的实验类型吗? - Can I use experimental types from typing_extensions? ModuleNotFoundError:没有名为“typing_extensions”的模块 - ModuleNotFoundError: No module named 'typing_extensions' 导入错误:无法从“键入”导入名称“文字” - ImportError: cannot import name 'Literal' from 'typing' 无法从 3.8 中的“打字”中导入名称“连接” - cannot import name 'Concatenate' from 'typing' in 3.8 我正在使用 Py 3.7 并尝试使用来自 typing_extensions 的 Final 和 final,但这些并没有停止重新分配或重载或 inheritance - I am using Py 3.7 and trying to use Final and final from typing_extensions, but these are not stopping reassignment or overloading or inheritance 构建 kivy 应用程序时出错:ModuleNotFoundError:没有名为“typing_extensions”的模块 - Error while building kivy app: ModuleNotFoundError: No module named 'typing_extensions' RHEL 8 - 由于 typing_extensions,无法完成 pyPDF2 离线安装 - RHEL 8 - Unable to complete pyPDF2 offline installation due to typing_extensions 从django_extensions.db导入UUIDField ImportError:无法导入名称UUIDField - from django_extensions.db import UUIDField ImportError: cannot import name UUIDField Pandas 导入错误“ImportError:无法从 &#39;pandas._typing&#39; 导入名称 &#39;FrameOrSeriesUnion&#39;” - Pandas importing error “ImportError: cannot import name 'FrameOrSeriesUnion' from 'pandas._typing' ”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM