qiskit/_util.py
def _check_ibmqx_version():
    """Check if the available IBMQuantumExperience version is the required one.

    Check that the installed "IBMQuantumExperience" package version matches the
    version required by the package, emitting a warning if it is not present.

    Note:
        The check is only performed when `qiskit` is installed via `pip`
        (available under `pkg_resources.working_set`). For other configurations
        (such as local development, etc), the check is skipped silently.
    """
    try:
        # Use a local import, as in very specific environments setuptools
        # might not be available or updated (conda with specific setup).
        import pkg_resources
        working_set = pkg_resources.working_set
        qiskit_pkg = working_set.by_key['qiskit']
    except (ImportError, KeyError):
        # If 'qiskit' was not found among the installed packages, silently
        # return.
        return

    # Find the IBMQuantumExperience version specified in this release of qiskit
    # based on pkg_resources (in turn, based on setup.py::install_requires).
    ibmqx_require = next(r for r in qiskit_pkg.requires() if
                         r.name == API_NAME)

    # Finally, compare the versions.
    try:
        # First try to use IBMQuantumExperience.__version__ directly.
        from IBMQuantumExperience import __version__ as ibmqx_version

        if ibmqx_version in ibmqx_require:
            return
    except ImportError:
        # __version__ was not available, so try to compare using the
        # working_set. This assumes IBMQuantumExperience is installed as a
        # library (using pip, etc).
        try:
            working_set.require(str(ibmqx_require))
            return
        except pkg_resources.DistributionNotFound:
            # IBMQuantumExperience was not found among the installed libraries.
            # The warning is not printed, assuming the user is using a local
            # version and takes responsibility of handling the versions.
            return
        except pkg_resources.VersionConflict:
            pass

    logger.warning('The installed IBMQuantumExperience package does '
                   'not match the required version - some features might '
                   'not work as intended. Please install %s.',
                   str(ibmqx_require))
Check if the available IBMQuantumExperience version is the required one.

    Check that the installed "IBMQuantumExperience" package version matches the
    version required by the package, emitting a warning if it is not present.

    Note:
        The check is only performed when `qiskit` is installed via `pip`
        (available under `pkg_resources.working_set`). For other configurations
        (such as local development, etc), the check is skipped silently.
    
Check if the available IBMQuantumExperience version is the required one.
Check that the installed "IBMQuantumExperience" package version matches the
version required by the package, emitting a warning if it is not present.


Check if the available IBMQuantumExperience version is the required one . Check that the installed " IBMQuantumExperience " package version matches the version required by the package emitting a warning if it is not present .
def _check_ibmqx_version():
    try:
        import pkg_resources
        working_set = pkg_resources.working_set
        qiskit_pkg = working_set.by_key['qiskit']
    except (ImportError, KeyError):
        return
    ibmqx_require = next(r for r in qiskit_pkg.requires() if
                         r.name == API_NAME)
    try:
        from IBMQuantumExperience import __version__ as ibmqx_version
        if ibmqx_version in ibmqx_require:
            return
    except ImportError:
        try:
            working_set.require(str(ibmqx_require))
            return
        except pkg_resources.DistributionNotFound:
            return
        except pkg_resources.VersionConflict:
            pass
    logger.warning('The installed IBMQuantumExperience package does '
                   'not match the required version - some features might '
                   'not work as intended. Please install %s.',
                   str(ibmqx_require))
def _check_ibmqx_version ( ) : try : import pkg_resources working_set = pkg_resources . working_set qiskit_pkg = working_set . by_key [ 'qiskit' ] except ( ImportError , KeyError ) : return ibmqx_require = next ( r for r in qiskit_pkg . requires ( ) if r . name == API_NAME ) try : from IBMQuantumExperience import __version__ as ibmqx_version if ibmqx_version in ibmqx_require : return except ImportError : try : working_set . require ( str ( ibmqx_require ) ) return except pkg_resources . DistributionNotFound : return except pkg_resources . VersionConflict : pass logger . warning ( 'The installed IBMQuantumExperience package does ' 'not match the required version - some features might ' 'not work as intended. Please install %s.' , str ( ibmqx_require ) )
Check if the available IBMQuantumExperience version is the required one.
Check if the available IBMQuantumExperience version is the required one .
"""Check if the available IBMQuantumExperience version is the required one.

    Check that the installed "IBMQuantumExperience" package version matches the
    version required by the package, emitting a warning if it is not present.

    Note:
        The check is only performed when `qiskit` is installed via `pip`
        (available under `pkg_resources.working_set`). For other configurations
        (such as local development, etc), the check is skipped silently.
    """ # Use a local import, as in very specific environments setuptools # might not be available or updated (conda with specific setup). # If 'qiskit' was not found among the installed packages, silently # return. # Find the IBMQuantumExperience version specified in this release of qiskit # based on pkg_resources (in turn, based on setup.py::install_requires). # Finally, compare the versions. # First try to use IBMQuantumExperience.__version__ directly. # __version__ was not available, so try to compare using the # working_set. This assumes IBMQuantumExperience is installed as a # library (using pip, etc). # IBMQuantumExperience was not found among the installed libraries. # The warning is not printed, assuming the user is using a local # version and takes responsibility of handling the versions.