question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: __init__() got an unexpected keyword argument 'file'

See original GitHub issue

Hello!

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:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lukmiscommented, Dec 11, 2017

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.

0reactions
xiguakaoyacommented, May 1, 2019

solve the same problem by updating the protobuf version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: __init__() got an unexpected keyword argument 'file'
Based on example in documentation Handling uploaded files with a model you mix two different methods and this makes problem.
Read more >
TypeError: __init__() got an unexpected keyword argument ...
After completing all the procedure, the following error was thrown while running run.py TypeError: init() got an unexpected keyword argument ...
Read more >
TypeError: Field.__init__() got an unexpected keyword ...
Dijango series part 1 section 3 (building a data model) after adding store & tags apps , if i tried to create a...
Read more >
TypeError: __init__() got an unexpected keyword ... - GitHub
I am using Google Collab Traceback (most recent call last): File ... TypeError: init() got an unexpected keyword argument 'box_keys'.
Read more >
init__() got an unexpected keyword argument 'max_iter'?
TypeError : init() got an unexpected keyword argument 'max_iter'. I m running the linear regression code in Community edition. Google says reinstall --....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found