-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Braket' object has no attribute 'get_device' #146
Comments
Thanks for reaching out. This probably has something to do with upgrading boto3 to have the braket client. Please run Let us know if this has solved your problem. |
Thank you for the answer. |
steps to reproduce
error
version infopip freeze | grep boto3
|
Thanks @jmp-aws, I'm still unable to reproduce the error. I think it's due to the AWS CLI not being up to date, because the get_device API isn't able to be called. Another option is to uninstall and re-install boto3. Or, to start from a new virtualenv and run: |
commands executed
output
pip freeze
|
Still unable to reproduce the error. Have you tried running: |
commands executed
output
working on trying to remove braket definition of aws cli installation commands executed
output
commands executed
output
|
@NicoSchwaller does removal of any aws cli models, uninstallation, and re-installation help resolve the issue? These are the commands that solved the issue for myself
|
Yes, this did solve the problem, thanks a lot! |
* make copy_aws_session public * Add docstring, make func non-static * change function name
Describe the bug
When executing the example bell.py, the following error appears:
AttributeError Traceback (most recent call last)
in
19 aws_account_id = boto3.client("sts").get_caller_identity()["Account"]
20
---> 21 device = AwsDevice("arn:aws:braket:::device/quantum-simulator/amazon/sv1")
22 s3_folder = (f"amazon-braket-output-{aws_account_id}", "folder-name")
23
~/braketvirtenv/lib/python3.7/site-packages/braket/aws/aws_device.py in init(self, arn, aws_session)
74 self._provider_name = None
75 self._type = None
---> 76 self.refresh_metadata()
77
78 def run(
~/braketvirtenv/lib/python3.7/site-packages/braket/aws/aws_device.py in refresh_metadata(self)
153 Refresh the
AwsDevice
object with the most recent Device metadata.154 """
--> 155 metadata = self._aws_session.get_device(self._arn)
156 self._name = metadata.get("deviceName")
157 self._status = metadata.get("deviceStatus")
~/braketvirtenv/lib/python3.7/site-packages/braket/aws/aws_session.py in get_device(self, arn)
116 Dict[str, Any]: Device metadata
117 """
--> 118 return self.braket_client.get_device(deviceArn=arn)
~/braketvirtenv/lib/python3.7/site-packages/botocore/client.py in getattr(self, item)
573 raise AttributeError(
574 "'%s' object has no attribute '%s'" % (
--> 575 self.class.name, item)
576 )
577
AttributeError: 'Braket' object has no attribute 'get_device'
To reproduce
Execute bell.py
Expected behavior
Get the result of the experiment
System information
A description of your system. Please provide:
The text was updated successfully, but these errors were encountered: