anchor.diff:    # It can also be installed at runtime from the pip wheel.
     # We disable appropriate tests below to allow building without pyscf installed
   
  +  # NOTE: we remove cplex b/c we can't build pythonPackages.cplex.
  +  # cplex is only distributed in manylinux1 wheel (no source), and Nix python is not manylinux1 compatible
  +
     postPatch = ''
       substituteInPlace setup.py \
  -      --replace "pyscf; sys_platform == 'linux' or (python_version < '3.8' and sys_platform != 'win32')" ""
  +      --replace "pyscf; sys_platform != 'win32'" "" \
  +      --replace "cplex; python_version >= '3.6' and python_version < '3.8'" ""
   
       # Add ImportWarning when running qiskit.chemistry (pyscf is a chemistry package) that pyscf is not included
  -    echo -e "\nimport warnings\ntry: import pyscf;\nexcept:\n    " \
  +    echo -e "\nimport warnings\ntry: import pyscf;\nexcept ImportError:\n    " \
         "warnings.warn('pyscf is not supported on Nixpkgs so some qiskit features will fail." \
           "You must install it yourself via pip or add it to your environment from the Nix User Repository." \
           "See https://github.com/NixOS/nixpkgs/pull/83447 for details', ImportWarning)\n" \
         >> qiskit/chemistry/__init__.py
  +
  +    # Add ImportWarning when running qiskit.optimization that cplex (optimization package) is not included
  +    echo -e "\nimport warnings\ntry: import cplex;\nexcept ImportError:\n    " \
  +      "warnings.warn('cplex is not supported on Nixpkgs so some qiskit features will fail." \
  +        "You must install it yourself via pip or add it to your environment from the Nix User Repository." \
  +        "', ImportWarning)\n" \
  +      >> qiskit/optimization/__init__.py
  +
     '';
   
  -  checkInputs = [ parameterized qiskit-aer pytestCheckHook ];
  +  postInstall = "rm -rf $out/${python.sitePackages}/docs";  # Remove docs dir b/c it can cause conflicts.
  +
  +  checkInputs = [ ddt qiskit-aer pytestCheckHook ];
     dontUseSetuptoolsCheck = true;
     pythonImportsCheck = [
       "qiskit.aqua"
  
positive.code: , pythonOlder
  , buildPythonPackage
  , fetchFromGitHub
  , cvxopt
  , dlx
  , docplex
  
negative.code:     owner = "Qiskit";
      repo = "qiskit-aqua";
      rev = version;
      sha256 = "0yykw6k1rb3f2ihcp0y9pb0695mcmy29nyqlj89qs4da0503vxvh";
    };
  
    # Optional packages: pyscf (see below NOTE) & pytorch. Can install via pip/nix if needed.
    propagatedBuildInputs = [
      # cplex
      cvxopt
      docplex
      dlx # Python Dancing Links package
  