导入 Spacy 时出现 Jupyter Notebook Python 错误:没有名为 click._bashcomplete 的模块

害怕

我的笔记本工作正常,直到 7 天前,这是我最后一次触摸它。现在我收到此错误。

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-76a01d9c502b> in <module>
----> 1 import spacy

~\AppData\Roaming\Python\Python38\site-packages\spacy\__init__.py in <module>
     12 
     13 from . import pipeline  # noqa: F401
---> 14 from .cli.info import info  # noqa: F401
     15 from .glossary import explain  # noqa: F401
     16 from .about import __version__  # noqa: F401

~\AppData\Roaming\Python\Python38\site-packages\spacy\cli\__init__.py in <module>
      1 from wasabi import msg
      2 
----> 3 from ._util import app, setup_cli  # noqa: F401
      4 
      5 # These are the actual functions, NOT the wrapped CLI commands. The CLI commands

~\AppData\Roaming\Python\Python38\site-packages\spacy\cli\_util.py in <module>
      6 import srsly
      7 import hashlib
----> 8 import typer
      9 from click import NoSuchOption
     10 from click.parser import split_arg_string

~\AppData\Roaming\Python\Python38\site-packages\typer\__init__.py in <module>
     27 
     28 from . import colors as colors
---> 29 from .main import Typer as Typer
     30 from .main import run as run
     31 from .models import CallbackParam as CallbackParam

~\AppData\Roaming\Python\Python38\site-packages\typer\main.py in <module>
      9 import click
     10 
---> 11 from .completion import get_completion_inspect_parameters
     12 from .core import TyperArgument, TyperCommand
     13 from .models import (

~\AppData\Roaming\Python\Python38\site-packages\typer\completion.py in <module>
      8 
      9 import click
---> 10 import click._bashcomplete
     11 
     12 from .models import ParamMeta

ModuleNotFoundError: No module named 'click._bashcomplete'

更新:

我重新安装了spacy。现在我收到此错误:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-76a01d9c502b> in <module>
----> 1 import spacy

~\Anaconda3\lib\site-packages\spacy\__init__.py in <module>
      8 
      9 # These are imported as part of the API
---> 10 from thinc.neural.util import prefer_gpu, require_gpu
     11 
     12 from . import pipeline

ModuleNotFoundError: No module named 'thinc.neural'

然后我重新安装了thinc,但错误并没有消失。我将尝试建议的其他答案。我打字更多是因为 stackoverflow 不允许我保存编辑,因为它说我的帖子主要是代码。

编辑2:

好的,所以我在重新安装 Thinc 后重新安装了 spacy,现在它似乎可以正常工作了。呸..

polm23

卸载 click 和 spaCy,然后重新安装 spaCy。如果可能的话,最好在一个干净的环境中开始,但至少只做这两个应该有效。

澄清一下,这是因为最新版本的 click 不适用于 spaCy。spaCy 指定使用旧的点击版本,因此在您安装 spaCy 时会安装该版本,但如果您升级,点击您自己的 spaCy 不会阻止您。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

将 Python Twint 模块导入 Jupyter Notebook 时出现问题 - ModuleNotFoundError:没有名为“twint”的模块

导入错误:使用 docker 在 Jupyter Notebook 上没有名为...的模块

使用spacy导入错误:“没有名为en的模块”

Anaconda Jupyter Python2.7“导入错误:没有名为opencv的模块”

正在获取ModuleNotFoundError:在Jupyter Notebook上导入时,没有名为“ plotnine”的模块

使用PyCharm导入模块时出现错误,而使用Jupyter Notebook时不会发生错误

Python - 导入错误:没有名为站点的模块

Python导入错误:没有名为<myPackage>的模块

导入错误Python:没有名为“ card”的模块

导入错误:Python 中没有名为“基本”的模块

将Python模块导入Jupyter Notebook

ModuleNotFoundError:Jupyter Notebook中没有名为“ tensorflow”的模块

Jupyter Notebook中没有名为'graphviz'的模块

没有名为graphframes的模块Jupyter Notebook

Matplotlib,Jupyter Notebook:ImportError:没有名为Tkinter的模块

Jupyter Notebook ImportError:没有名为枚举的模块

在Jupyter Notebook ModuleNotFoundError中:没有名为'plotly'的模块

python-仅在某些文件中出现“导入错误没有名为httplib2的模块”

从mgltools运行PMV时出现“导入错误:没有名为oldnumeric的模块”

导入错误:使用 py2app 时没有名为“google-api-python-client”的模块

jupyter笔记本导入错误:没有名为“ matplotlib”的模块

ModuleNotFoundError:导入模块时没有名为“ x”的模块

Python 2.7.5 获取导入 OrderedDict 导入错误:没有名为 OrderedDict 的模块

导入错误Python 2.7。没有名为以下模块的模块:

“没有名为‘vlc’的模块”——用 Python 导入 VLC 时遇到问题

Apache NiFi中的Python错误:导入错误:没有名为Pandas的模块

当我尝试在Spyder上导入alpha_vantage时出现“没有名为'alpha_vantage'的模块”错误

导入tensorflow时,出现以下错误:没有名为“ numpy.core._multiarray_umath”的模块

在conda安装后导入模块时,jupyter Notebook中的ModuleNotFoundError