import paddle.v2.fluid has TypeError: __init__() got an unexpected keyword argument 'file'
I created a fresh virtualenv to install PaddlePaddle. (python 2.7.14) and then when I encountered import error when I simply tried to
import paddle.v2.fluid
and the error is
>>> import paddle.v2.fluid
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/wangjeff/workspace/externalTemplates_ref/testvenv/lib/python2.7/site-packages/paddle/v2/fluid/__init__.py", line 2, in <module>
import framework
File "/Users/wangjeff/workspace/externalTemplates_ref/testvenv/lib/python2.7/site-packages/paddle/v2/fluid/framework.py", line 5, in <module>
import proto.framework_pb2 as framework_pb2
File "/Users/wangjeff/workspace/externalTemplates_ref/testvenv/lib/python2.7/site-packages/paddle/v2/fluid/proto/framework_pb2.py", line 194, in <module>
options=None, file=DESCRIPTOR),
TypeError: __init__() got an unexpected keyword argument 'file'
It seems that the Paddle set the protobuf version to be 3.1 and protobuf version 3.1 's FieldDescriptor doesn't have member file. We can fix this issue by changing the pip requirement.txt to have protobuf>=3.4, where FieldDescriptor does have a file member.
The same error in #8549
您好,此issue在近一个月内暂无更新,我们将于今天内关闭。若在关闭后您仍需跟进提问,可重新开启此问题,我们将在24小时内回复您。因关闭带来的不便我们深表歉意,请您谅解~感谢您对PaddlePaddle的支持! Hello, this issue has not been updated in the past month. We will close it today for the sake of other user‘s experience. If you still need to follow up on this question after closing, please feel free to reopen it. In that case, we will get back to you within 24 hours. We apologize for the inconvenience caused by the closure and thank you so much for your support of PaddlePaddle Group!