Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行代码出现 name 'libpaddle' is not defined #53073

Open
xia6321 opened this issue Apr 19, 2023 · 14 comments
Open

运行代码出现 name 'libpaddle' is not defined #53073

xia6321 opened this issue Apr 19, 2023 · 14 comments
Assignees
Labels
status/reopen 重新打开 type/build 编译/安装问题

Comments

@xia6321
Copy link

xia6321 commented Apr 19, 2023

bug描述 Describe the Bug

文件夹里面有libpaddle.lib和libpaddle.pyd两个文件,但运行的时候找不到libpaddle

代码from paddleocr import PaddleOCR, draw_ocr
ocr = PaddleOCR(use_angle_cls=True, use_gpu=True,
lang="ch") # need to run only once to download and load model into memory
img_path = 'E:\test\dd\hf\4.JPG'
result = ocr.ocr(img_path, cls=True)
for line in result:
# print(line[-1][0], line[-1][1])
print(line)

错误详细信息
Message=name 'libpaddle' is not defined
Source=E:\55\PythonApplication1\PythonApplication1.py
StackTrace:
File "E:\55\PythonApplication1\PythonApplication1.py", line 1, in (Current frame)
from paddleocr import PaddleOCR, draw_ocr

其他补充信息 Additional Supplementary Information

使用的是Windows系统,CPU版本,paddlepaddle和paddleocr安装的是最新版本的,由于和protobuf3.20.3不兼容我把protobuf改为了3.19.0版本,visualdl改为了2.1.0,onnx改为了1.9.0

@LiYuRio
Copy link
Contributor

LiYuRio commented Apr 19, 2023

麻烦尝试一下直接在python命令行,输入import paddle,确定paddle能否正确被import

@xia6321
Copy link
Author

xia6321 commented Apr 19, 2023

麻烦尝试一下直接在python命令行,输入import paddle,确定paddle能否正确被import

不能,也是同样的错误

@LiYuRio
Copy link
Contributor

LiYuRio commented Apr 19, 2023

那看起来就是paddle安装的问题了,是用的这里的命令吗,https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/windows-pip.html

@xia6321
Copy link
Author

xia6321 commented Apr 19, 2023

那看起来就是paddle安装的问题了,是用的这里的命令吗,https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/windows-pip.html

是的

@LiYuRio
Copy link
Contributor

LiYuRio commented Apr 19, 2023

建议使用--force-reinstall重装一下试试

@xia6321
Copy link
Author

xia6321 commented Apr 20, 2023

建议使用--force-reinstall重装一下试试

我在虚拟环境里装还是不行,但我直接安装就可以

@LiYuRio
Copy link
Contributor

LiYuRio commented Apr 20, 2023

请问你那里使用,是有在虚拟环境下使用的需求吗

@paddle-bot paddle-bot bot added status/reopen 重新打开 type/build 编译/安装问题 and removed status/new-issue 新建 type/bug-report 报bug labels Apr 20, 2023
@Jmlie
Copy link

Jmlie commented May 9, 2023

请问CUDA版本为11.4时,安装paddle版本为CUDA11.2时会报这个错,而俩版本匹配时则不会出现这个问题,是版本不匹配的原因吗?

@Jmlie
Copy link

Jmlie commented May 9, 2023

建议使用--force-reinstall重装一下试试

重新安装并没有成功

@Larkelmes
Copy link

那看起来就是paddle安装的问题了,是用的这里的命令吗,https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/windows-pip.html

winserver2022 python=3.10.8 cuda=11.8 按照此步骤并使用--force-reinstall安装后问题复现

@ollyestn
Copy link

这个问题一直没有解决吗?今天我又出现了,win10,python=3.10.6,gpu=True/False 都出现这个问题;刚安装的系统

@zbbwss
Copy link

zbbwss commented Oct 30, 2023

这个有解决成功的吗?

@xia6321
Copy link
Author

xia6321 commented Oct 30, 2023 via email

@tjubjy
Copy link

tjubjy commented Jan 29, 2024

我也遇到同样的问题,最后用python3.7版本编译出来的可以成功import了,另外GCC版本最好不要太高,我编译时看它说推荐8.0以下
看另一个回答说python换成3.7、gcc、g++换成7.5.0可以解决。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/reopen 重新打开 type/build 编译/安装问题
Projects
None yet
Development

No branches or pull requests

7 participants