0
$\begingroup$

I ve beeen trying to use the qiskit package from spyder IDE inisde anaconda (Python version 3.7) but when i try to acces my account I get the following error:

 runfile('H:/Python Projects/QComputing/account_save.py', wdir='H:/Python Projects/QComputing')
[{'token': 'MYTOKEN', 'url': 'https://quantumexperience.ng.bluemix.net/api'}]

runfile('H:/Python Projects/QComputing/account_save.py', wdir='H:/Python Projects/QComputing')
[{'token': 'MYTOKEN', 'url': 'https://quantumexperience.ng.bluemix.net/api'}]
Traceback (most recent call last):

  File "<ipython-input-5-c4b9a517fa2c>", line 1, in <module>
    runfile('H:/Python Projects/QComputing/account_save.py', wdir='H:/Python Projects/QComputing')

  File "C:\Users\Admin\Anaconda3\envs\QComputing\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
    execfile(filename, namespace)

  File "C:\Users\Admin\Anaconda3\envs\QComputing\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "H:/Python Projects/QComputing/account_save.py", line 14, in <module>
    qsk.IBMQ.load_accounts()

  File "C:\Users\Admin\Anaconda3\envs\QComputing\lib\site-packages\qiskit\providers\ibmq\ibmqprovider.py", line 199, in load_accounts
    self._append_account(credentials)

  File "C:\Users\Admin\Anaconda3\envs\QComputing\lib\site-packages\qiskit\providers\ibmq\ibmqprovider.py", line 279, in _append_account
    single_provider = IBMQSingleProvider(credentials, self)

  File "C:\Users\Admin\Anaconda3\envs\QComputing\lib\site-packages\qiskit\providers\ibmq\ibmqsingleprovider.py", line 52, in __init__
    self._api = self._authenticate(self.credentials)

  File "C:\Users\Admin\Anaconda3\envs\QComputing\lib\site-packages\qiskit\providers\ibmq\ibmqsingleprovider.py", line 103, in _authenticate
    .format(ex)) from root_exception

ConnectionError: Couldn't connect to IBMQ server: error during login: Expecting value: line 1 column 1 (char 0)

I run only the following commands:

import qiskit as qsk
print(qsk.IBMQ.stored_accounts())
qsk.IBMQ.load_accounts()

and i have already created an account(with account save command). I have tried closing the antivirus software. Any ideas? Thanks.

$\endgroup$
  • $\begingroup$ What version of qiskit are you running? Specifically qiskit-ibmq-provider? You can see all of your qiskit verisons by importing qiskit: import qiskit and then running qiskit.__qiskit_version__ $\endgroup$ – Matthew Stypulkoski Dec 10 '19 at 15:39
1
$\begingroup$

Try to run this code:

from qiskit import IBMQ

IBMQ.save_account('your_api_token')

And for access:

IBMQ.load_account()# without the 's'

Hope this helps.

| improve this answer | |
$\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.