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.

'Braket' object has no attribute 'get_device'

See original GitHub issue

Describe the bug When executing the example bell.py, the following error appears:


AttributeError Traceback (most recent call last) <ipython-input-2-33823a40ea20> in <module> 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:

  • Amazon Braket Python SDK version: v1.0.0.post1
  • Amazon Braket Python Schemas version: v1.0.0.post1
  • Amazon Braket Python Default Simulator version: v1.0.0.post1
  • Python version: 3.7.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jmp-awscommented, Aug 19, 2020

@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

brew uninstall awscli
rm -rf ~/.aws/models/aqx
rm -rf ~/.aws/models/braket
brew install awscli
aws braket help
0reactions
NicoSchwallercommented, Aug 20, 2020

@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

brew uninstall awscli
rm -rf ~/.aws/models/aqx
rm -rf ~/.aws/models/braket
brew install awscli
aws braket help

Yes, this did solve the problem, thanks a lot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Class: Aws::Braket::Client — AWS SDK for Ruby V3
Defined in: gems/aws-sdk-braket/lib/aws-sdk-braket/client.rb ... This option has no effect unless the request has "Expect" header set to "100-continue".
Read more >
braket.pennylane_plugin.BraketAwsQubitDevice
You can get device ARNs using AwsDevice.get_devices , from the Amazon Braket ... An AwsSession object created to manage interactions with AWS services, ......
Read more >
AttributeError: 'tuple' object has no attribute 'replace' For brackets
i have a simple code for trying to rename ...
Read more >
Technical-Questions 2022 - Webots documentation
Webots use the bounding objects to calculate the physics behavior, ... fails with AttributeError: 'Node' object has no attribute 'getDevice'. and this:
Read more >
VMware ESXi 6.5 Update 2 Release Notes
Attempts to create a host profile might fail with an error NoneType object has no attribute lower if you pass a null value...
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