我正在关注 nlp 教程,这是我正在观看的视频:https://www.youtube.com/watch?v=h2kBNEShsiE&list=PLeo1K3hjS3uuvuAXhYjV2lMEShq2UYSwX&index=7
在视频中,讲师要求我们运行命令 python -m spacy download en 但当我尝试运行它时,我得到了这个:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\alokk\AppData\Local\Programs\Python\Python311\Lib\site-packages\spacy\__main__.py", line 4, in <module>
setup_cli()
File "C:\Users\alokk\AppData\Local\Programs\Python\Python311\Lib\site-packages\spacy\cli\_util.py", line 87, in setup_cli
command(prog_name=COMMAND)
File "C:\Users\alokk\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 829, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alokk\AppData\Local\Programs\Python\Python311\Lib\site-packages\typer\core.py", line 783, in main
return _main(
^^^^^^
File "C:\Users\alokk\AppData\Local\Programs\Python\Python311\Lib\site-packages\typer\core.py", line 199, in _main
args = click.utils._expand_args(args)
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'click.utils' has no attribute '_expand_args'
我尝试过在 vscode 命令提示符、命令提示符、管理员命令提示符、powershell 和管理员 powershell 中运行它。
有人可以帮助我吗?
我尝试安装 spacy 的 en 库,但它不起作用并返回错误。
尝试升级
click
pip install --upgrade click
或者
pip install -U click
https://pypi.org/project/click/
如果您使用 Jupyter,请重新启动内核。