1
$\begingroup$

I just got started with Qiskit. When I tried to save my account with the API token from IBMQ website, I got the error: warnings.warn('Credentials already present. Set overwrite=True to overwrite.'). Then I set overwrite = True but the warning was still raised and I cannot save the account and connect to the server.

$\endgroup$
  • $\begingroup$ Welcome to quantum computing SE! I hope you don't mind that I've made slight adjustments to the formatting of the question. If you've got any questions about the site, feel free to take the tour, have a look around Quantum Computing Meta and join us in Quantum Computing Chat $\endgroup$ – Mithrandir24601 Feb 21 at 9:15
1
$\begingroup$

Here's some general info, which will hopefully help you find and fix your issue.

You can try using

print(IBMQ.stored_accounts())

to see what accounts you have stored on disk, and maybe see why they aren't working.

To simultaneously sign into all accounts on this list, use

IBMQ.load_accounts()

To only sign into the first, use

token = IBMQ.stored_accounts()[0]['token']
url = IBMQ.stored_accounts()[0]['url']
IBMQ.enable_account(token,url)

To only sign into the second, replace the [0] above with [1], and so on.

To see which accounts you are currently logged into, use

print(IBMQ.active_accounts())

If you want to start afresh by removing all accounts from disk, use

IBMQ.delete_accounts()

Adding new accounts is then done with

IBMQ.save_account(token,url)

Where token is a string that represents your API token, and

url = 'https://quantumexperience.ng.bluemix.net/api'

for those using the public level access.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.