I am trying to run this QSVM tutorial using qiskit from my Python environment using Jupyter Notebook

Firstly it gives me an error that I have to install qiskit-aqua[cvx] when I try to run this code -

backend = BasicAer.get_backend('qasm_simulator')
quantum_instance = QuantumInstance(backend, shots=1024, seed_simulator=seed,seed_transpiler=seed)
result = qsvm.run(quantum_instance)

Then after I install the above package. I keep on getting the error - 'BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.'

I also try using the following code at the beginning of the notebook as per here https://github.com/Qiskit/qiskit-aer/issues/924. But no luck.

import os 
os.environ['MPMATH_NOSAGE'] = 'true'

Any help is highly appreciated.

Regards, Sourav

  • $\begingroup$ Hi and welcome to the community! Quick questions : what is your Python version and the Qiskit version you are running? I remember some problems of versions for old versions of Qiskit with the latest version of Python, you can run this two lines to get both on a notebook import qiskit.tools.jupyter and then %qiskit_version_table $\endgroup$
    – Lena
    Apr 1, 2021 at 8:06
  • 1
    $\begingroup$ @Lena added below $\endgroup$ Apr 1, 2021 at 12:29
  • $\begingroup$ According to this upgrading to python 3.8 worked to fix the issue, did you try? $\endgroup$
    – Lena
    Apr 1, 2021 at 12:58
  • $\begingroup$ @Lena - No. I cannot upgrade to 3.8. It is a bit restricted env. $\endgroup$ Apr 1, 2021 at 13:09
  • $\begingroup$ Do you have the same issue with qiskit 0.23.6? $\endgroup$
    – Lena
    Apr 1, 2021 at 13:10

2 Answers 2


Please create a new conda env & install all reqd packages in there

Conda create a new env -https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

Conda activate your env & install these stuff 

conda install python=3.8.3
conda install -c anaconda pandas
conda install -c anaconda cmake
conda install -c anaconda libxml2
conda install scikit-learn
conda install cryptography
conda install -c anaconda libxslt
conda install -c anaconda pandas
conda install h5py 
conda install pytest
conda install -c conda-forge cvxpy
conda install -c conda-forge pymetis
conda install -c conda-forge cvxopt
conda install -c conda-forge cvxpy
conda install ipywidgets
conda install lxml
conda install wheel

pip install qiskit-ibmq-provider
pip install qiskit-terra
pip install qiskit-ignis 
pip install qiskit-aqua==0.8.2
pip install qiskit-aer==0.7.3
Pip install qiskit  # this will update qiskit aqua 

After installation try to run this example https://github.com/Qiskit/qiskit-tutorials/blob/master/tutorials/machine_learning/01_qsvm_classification.ipynb

  • $\begingroup$ Creating a new conda env is not an acceptable solution. creating a completely new conda env is not a solution in my case the end user cannot create a new conda env. The entire purpose wud be defeated. if that is the only solution I need a solution where user can run the tutorial just doing only pip install from teh Notebook. $\endgroup$ Apr 1, 2021 at 6:47

I finally could make it work with

qiskit-aqua[cvx] qiskit-terra': '0.16.4', qiskit-aer': '0.7.6', qiskit-ignis': '0.5.2', qiskit-ibmq-provider': '0.12.2', qiskit-aqua': '0.8.2', qiskit': '0.24.1'

And by increasing the core and memory.

Thanks for all help.

Regards, Sourav


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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