Skip to content

[Bug]: 依存句法分析使用出错,提示LAC依赖,但是LAC已经安装 #9378

@yunc0701

Description

@yunc0701

软件环境

- paddlepaddle:2.6.2
- paddlepaddle-gpu: 非GPU
- paddlenlp: 2.6.1

重复问题

  • I have searched the existing issues

错误描述

使用paddlenlp运行依存句法分析时报错,提示LAC依赖没有找到,但是LAC已经安装了

稳定复现步骤 & 代码

from paddlenlp import Taskflow
ddp = Taskflow("dependency_parsing", model="ddparser-ernie-gram-zh",use_pos=True)
运行之后,出现以下错误
Traceback (most recent call last):
File "D:\anaconda3\envs\py310\lib\site-packages\paddlenlp\taskflow\dependency_parsing.py", line 183, in init
from LAC import LAC
File "D:\anaconda3\envs\py310\lib\site-packages\LAC_init_.py", line 23, in
from .lac import LAC
File "D:\anaconda3\envs\py310\lib\site-packages\LAC\lac.py", line 28, in
import paddle.fluid as fluid
ModuleNotFoundError: No module named 'paddle.fluid'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "D:\anaconda3\envs\py310\lib\site-packages\paddlenlp\taskflow\taskflow.py", line 804, in init
self.task_instance = task_class(
File "D:\anaconda3\envs\py310\lib\site-packages\paddlenlp\taskflow\dependency_parsing.py", line 185, in init
raise ImportError("Please install the dependencies first, pip install LAC --upgrade")
ImportError: Please install the dependencies first, pip install LAC --upgrade

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingstale

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions