I try to use Quantum SVM kernel algorithm: multiclass classifier extension. This is my code section with imports

import numpy as np
import scipy
from scipy.linalg import expm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from sklearn.decomposition import PCA

from qiskit import BasicAer
from qiskit_aqua import run_algorithm
from qiskit_aqua.input import SVMInput
import qsvm_datasets 

I have an error at import any library. I received the ImportError: DLL load failed: message. All libs are installed correctly. I found in my folders needed file at \Python\Libs\site-packages\qiskit_aqua\input\svminput.py.

That's my debug log:

Warning (from warnings module):
  File "D:\QASM\Python368\lib\site-packages\sklearn\externals\joblib\externals\cloudpickle\cloudpickle.py", line 47
    import imp
DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
Traceback (most recent call last):
  File "\1.py", line 14, in <module>
    from qiskit_aqua import run_algorithm
  File "D:\QASM\Python368\lib\site-packages\qiskit_aqua\__init__.py", line 29, in <module>
    from .utils.backend_utils import (get_aer_backend,
  File "D:\QASM\Python368\lib\site-packages\qiskit_aqua\utils\__init__.py", line 31, in <module>
    from .qpsolver import optimize_svm
  File "D:\QASM\Python368\lib\site-packages\qiskit_aqua\utils\qpsolver.py", line 21, in <module>
    from cvxopt import matrix, solvers
  File "D:\QASM\Python368\lib\site-packages\cvxopt\__init__.py", line 50, in <module>
    import cvxopt.base
ImportError: DLL load failed
  • 1
    $\begingroup$ I feel like you would probably get more useful answers posting these as issues on the project's GitHub. This sounds like some bug in the code that only they can solve (or at least, a lack of clarity in the documentation) $\endgroup$
    – glS
    Mar 18, 2019 at 12:40
  • $\begingroup$ anyway, here is the current version of the library you are trying to use. When you issue the from qiskit_aqua.input ... command the __init__.py file is automatically executed, so the problem might be in some other module in the subpackage, not necessarily in the SVMInput class. It's hard to tell what exactly is going on without you posting the full error message (which includes the line at which the error occurred) $\endgroup$
    – glS
    Mar 18, 2019 at 16:10

1 Answer 1


You are probably running Python 3.7 on Windows. There is a known issue for the bug you are seeing: https://github.com/Qiskit/qiskit-aer/issues/80

  • $\begingroup$ But I use Python 3.6.8 $\endgroup$
    – mitrik_bnr
    Mar 19, 2019 at 8:36
  • 1
    $\begingroup$ Your absolutely right. And the error is not the one I posted. Looking more carefully the error appears to be in the cvxopt package and not qiskit itself. $\endgroup$ Mar 19, 2019 at 13:17
  • $\begingroup$ Problem was in cvxopt. For correct work the Numpy+MKL library must to be installed (from here, for example - lfd.uci.edu/~gohlke/pythonlibs/#numpy) $\endgroup$
    – mitrik_bnr
    Mar 20, 2019 at 7:30

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.