ERNIE icon indicating copy to clipboard operation
ERNIE copied to clipboard

ImportError: No module named paddle.fluid

Open Zengpr opened this issue 7 years ago • 11 comments

执行bash script/pretrain.sh提示: ImportError: No module named paddle.fluid

但单独使用 python3 进入python解释器,然后使用import paddle.fluid并没有报这个错

Zengpr avatar Mar 18 '19 03:03 Zengpr

i just pip install paddlepaddle, then mv the pretrain script to "train.py"'s dictionary, finally run it and success

bfjia1 avatar Mar 18 '19 03:03 bfjia1

@jiabinfeng I pip install paddlepaddle too, mv the pretrain script under the ERNIE directory? but I'm not successully 2019-03-18 11-39-00屏幕截图

Zengpr avatar Mar 18 '19 03:03 Zengpr

@jiabinfeng I pip install paddlepaddle too, mv the pretrain script under the ERNIE directory? but I'm not successully 2019-03-18 11-39-00屏幕截图

image i just run the code in command line previously, when i see your pic, i try to run this code in pycharm, first i met the same problem as you, this is caused by python env, so i change it and done all

bfjia1 avatar Mar 18 '19 12:03 bfjia1

@jiabinfeng I have create a new env, and pip install paddlepaddle-gpu, but I still met the problem 2019-03-19 09-04-04屏幕截图

Zengpr avatar Mar 19 '19 01:03 Zengpr

我也遇到了同样的问题,目前只能在 cmd 中运行

LCG22 avatar Mar 19 '19 03:03 LCG22

我cmd都不行呀

Zengpr avatar Mar 19 '19 03:03 Zengpr

我cmd都不行呀

或者你应该试试 Anaconda prompt

LCG22 avatar Mar 19 '19 03:03 LCG22

@LCG22 什么意思

Zengpr avatar Mar 19 '19 03:03 Zengpr

@LCG22 什么意思

类似 cmd 的

LCG22 avatar Mar 19 '19 03:03 LCG22

@Zengpr 可能你的环境中存在多个python环境,你可以解释一下运行 script 的时候与cmd启动的是同一个python解释器

kuke avatar Mar 19 '19 06:03 kuke

@kuke 直接把pretrain.sh的内容在cmd运行成功了,谢谢!

Zengpr avatar Mar 19 '19 06:03 Zengpr