You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clone this repo. I cloned today, and am at: 1041d44
cd ibm-quantum-challenge-2024/content/lab_0
ipython lab-0.ipynb
Tried on an M1 Mac with Python 3.11.5
Actual behavior
The line from qiskit_ibm_runtime import EstimatorV2 as Estimator
fails with ImportError: cannot import name 'ValidationInfo' from 'pydantic'.
This is the same error message as in Qiskit/qiskit-ibm-runtime#1577
Full error message:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[1], line 5
3 from qiskit import QuantumCircuit
4 from qiskit.quantum_info import SparsePauliOp
----> 5 from qiskit_ibm_runtime import EstimatorV2 as Estimator
6 from qiskit_aer import AerSimulator
7 import matplotlib.pyplot as plt
File ~/anaconda3/lib/python3.11/site-packages/qiskit_ibm_runtime/__init__.py:220
217 from .utils.utils import setup_logger
218 from .version import __version__
--> 220 from .estimator import ( # pylint: disable=reimported
221 EstimatorV2,
222 EstimatorV1,
223 EstimatorV1 as Estimator,
224 )
225 from .sampler import ( # pylint: disable=reimported
226 SamplerV2,
227 SamplerV1,
228 SamplerV1 as Sampler,
229 )
230 from .options import Options, EstimatorOptions, SamplerOptions, OptionsV2
File ~/anaconda3/lib/python3.11/site-packages/qiskit_ibm_runtime/estimator.py:30
28 from .runtime_job_v2 import RuntimeJobV2
29 from .ibm_backend import IBMBackend
---> 30 from .options import Options
31 from .options.estimator_options import EstimatorOptions
32 from .base_primitive import BasePrimitiveV1, BasePrimitiveV2
File ~/anaconda3/lib/python3.11/site-packages/qiskit_ibm_runtime/options/__init__.py:98
1 # This code is part of Qiskit.
2 #
3 # (C) Copyright IBM 2022, 2024
(...)
10 # copyright notice, and modified files need to carry a notice indicating
11 # that they have been altered from the originals.
13 """
14 =====================================================
15 Primitive options (:mod:`qiskit_ibm_runtime.options`)
(...)
95
96 """
---> 98 from .environment_options import EnvironmentOptions
99 from .execution_options import ExecutionOptions
100 from .execution_options import ExecutionOptionsV2
File ~/anaconda3/lib/python3.11/site-packages/qiskit_ibm_runtime/options/environment_options.py:17
13 """Options related to the execution environment."""
15 from typing import Optional, Callable, List, Literal
---> 17 from .utils import primitive_dataclass
19 LogLevelType = Literal[
20 "DEBUG",
21 "INFO",
(...)
24 "CRITICAL",
25 ]
28 @primitive_dataclass
29 class EnvironmentOptions:
File ~/anaconda3/lib/python3.11/site-packages/qiskit_ibm_runtime/options/utils.py:23
20 from dataclasses import is_dataclass, asdict
21 from numbers import Real
---> 23 from pydantic import ConfigDict, ValidationInfo, field_validator
24 from pydantic.dataclasses import dataclass
26 from qiskit.providers.backend import Backend
ImportError: cannot import name 'ValidationInfo' from 'pydantic' (/Users/mheiber/anaconda3/lib/python3.11/site-packages/pydantic/__init__.cpython-311-darwin.so)
Expected behavior
Runs without import errors
thanks for your work on the Quantum Challenge
The text was updated successfully, but these errors were encountered:
mheiber
changed the title
Can't run first lab locally: ImportError: cannot import name 'ValidationInfo' from 'pydantic'
Can't run lab 0 locally: ImportError: cannot import name 'ValidationInfo' from 'pydantic'
Jun 7, 2024
Steps to Repro
clone this repo. I cloned today, and am at: 1041d44
cd ibm-quantum-challenge-2024/content/lab_0
ipython lab-0.ipynb
Tried on an M1 Mac with Python 3.11.5
Actual behavior
The line
from qiskit_ibm_runtime import EstimatorV2 as Estimator
fails with
ImportError: cannot import name 'ValidationInfo' from 'pydantic'
.This is the same error message as in Qiskit/qiskit-ibm-runtime#1577
Full error message:
Expected behavior
Runs without import errors
The text was updated successfully, but these errors were encountered: