bug描述 Describe the Bug
通过官方文档,安装paddlepaddle库
python -m pip install paddlepaddle -i https://pypi.tuna.tsinghua.edu.cn/simple
然后运行检查语句
import paddle
报错如下:
Error: Can not import paddle core while this file exists: K:\code\py_demo\venv\lib\site-packages\paddle\fluid\libpaddle.pyd
Traceback (most recent call last):
File "K:\code\py_demo\venv\lib\site-packages\paddle\fluid\core.py", line 269, in
from . import libpaddle
ImportError: DLL load failed while importing libpaddle: 动态链接库(DLL)初始化例程失败。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1027, in find_and_load
File "", line 1006, in find_and_load_unlocked
File "", line 688, in load_unlocked
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "K:\code\py_demo\venv\lib\site-packages\paddleocr_init.py", line 14, in
from .paddleocr import *
File "K:\code\py_demo\venv\lib\site-packages\paddleocr\paddleocr.py", line 21, in
import paddle
File "K:\code\py_demo\venv\lib\site-packages\paddle_init.py", line 31, in
from .framework import monkey_patch_variable
File "K:\code\py_demo\venv\lib\site-packages\paddle\framework_init.py", line 17, in
from . import random # noqa: F401
File "K:\code\py_demo\venv\lib\site-packages\paddle\framework\random.py", line 17, in
from paddle import fluid
File "K:\code\py_demo\venv\lib\site-packages\paddle\fluid_init.py", line 36, in
from . import framework
File "K:\code\py_demo\venv\lib\site-packages\paddle\fluid\framework.py", line 35, in
from . import core
File "K:\code\py_demo\venv\lib\site-packages\paddle\fluid\core.py", line 351, in
if not avx_supported() and libpaddle.is_compiled_with_avx():
NameError: name 'libpaddle' is not defined
其他补充信息 Additional Supplementary Information
环境:windows10
python:Python 3.10.11
paddlepaddle-2.5.1
无GPU版本
补充:
同样代码,在linux上面跑正常运行,在windows上面跑一直提示上面报错,试过安装其他版本的paddle也是报错
2条答案
按热度按时间nfg76nw01#
在安装时候加上版本号试一下 eg. paddlepaddle==2.5.1
vsnjm48y2#
我也是这个问题,安装完后报错
,
win10
cuda版本10.2
python版本3.10
安装命令
python -m pip install paddlepaddle-gpu==2.4.2 -i https://pypi.tuna.tsinghua.edu.cn/simple