본문 바로가기

공부/코딩

[qiskit/IBM Quantum challenge 2024]ModuleNotFoundError: No module named 'qiskit_serverless' 에러 대처방법

반응형

퀀텀 챌린지에서 정답을 채점하기 위한 챌린지 자체 패키지를 도입하려고 할 때 에러가 생겼다.

from qc_grader.challenges.iqc_2024 import (
    grade_lab1_ex1,
    grade_lab1_ex2,
    grade_lab1_ex3,
    grade_lab1_ex4,
    grade_lab1_ex5,
    grade_lab1_ex6,
    grade_lab1_ex7,
)

 

에러 내용

ModuleNotFoundError: No module named 'qiskit_serverless' 라는 에러가 나왔다.

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[5], line 2
      1 # 답안을 채점할 grader 함수를 불러옵니다
----> 2 from qc_grader.challenges.iqc_2024 import (
      3     grade_lab1_ex1,
      4     grade_lab1_ex2,
      5     grade_lab1_ex3,
      6     grade_lab1_ex4,
      7     grade_lab1_ex5,
      8     grade_lab1_ex6,
      9     grade_lab1_ex7,
     10 )
...
File ~/.pyenv/versions/3.12.3/envs/env3123/lib/python3.12/site-packages/qc_grader/challenges/iqc_2024/lab3.py:6
      3 from typing import Callable
      5 from qiskit import QuantumCircuit
----> 6 from qiskit_serverless.core.function import QiskitFunction
      7 from qiskit import QuantumCircuit
      8 from qiskit_serverless.core.job import Job

ModuleNotFoundError: No module named 'qiskit_serverless'

 

대처 방법

qc_grader를 삭제하고 다시 깔면 된다. 

!pip uninstall qc_grader --yes
!pip install git+https://github.com/qiskit-community/Quantum-Challenge-Grader.git



반응형