TypeError: __init__() got an unexpected keyword argument 'file'
See original GitHub issueHello!
Excited to try sage-maker but getting the error below after pip install sagemaker
in new virtualenv. Python 2.7.10, Sierra 10.12.6. New to this product but would love to get some direction on this.
Traceback (most recent call last): File "python.py", line 29, in <module> import sagemaker File "****/lib/python2.7/site-packages/sagemaker/__init__.py", line 16, in <module> from sagemaker.amazon.kmeans import KMeans, KMeansModel, KMeansPredictor File "***/lib/python2.7/site-packages/sagemaker/amazon/kmeans.py", line 13, in <module> from sagemaker.amazon.amazon_estimator import AmazonAlgorithmEstimatorBase, registry File "***/lib/python2.7/site-packages/sagemaker/amazon/amazon_estimator.py", line 19, in <module> from sagemaker.amazon.common import write_numpy_to_dense_tensor File "****/lib/python2.7/site-packages/sagemaker/amazon/common.py", line 19, in <module> from sagemaker.amazon.record_pb2 import Record File "***/lib/python2.7/site-packages/sagemaker/amazon/record_pb2.py", line 41, in <module> options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), _b('\020\001')), file=DESCRIPTOR), TypeError: __init__() got an unexpected keyword argument 'file'
Any direction welcome.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Hi and thanks for trying sagemaker!
The error comes from the generated file so I suspect the issue here might be related to version differences. Specifically, the google.protobuf is a dependency of this file and looks like the version you are using has different class definition.
Could you check what version of protobuf you have installed in your virtualenv? For instance please run: pip freeze | grep proto to quickly discover that.
When I run it I see 3.5.0 and didn’t hit this problem. If you can change this version in your virtualenv and try again this should go away. Please let us know if this was the case.
solve the same problem by updating the protobuf version.