skip to Main Content

I am trying to work with cvzone library in Python using VSCode. I have installed the library using
pip install cvzone. But when trying to import the library, ModuleNotFoundError is being raised.

import cvzone

Output

ModuleNotFoundError: No module named 'cvzone'
  • I have checked that the correct environment is activated in terminal
  • Have checked that the interpreter is correctly selected
  • Ran pip list and ensured that the library is installed
  • Tried to import using python in terminal, and worked correctly

I tried to run the same in Colab and it was successfully imported. But when trying to run in Jupyter Notebook in VSCode, it is not working.

  • Using cvzone 1.5.6

2

Answers


  1. Chosen as BEST ANSWER

    I deleted the virtualenv, created a new one (with another name. First, I created one with the same name, but it showed the same issue), and reinstalled all the packages. Then it worked! I don't know what was wrong, but anyway... Thank you all for answering.


  2. But when trying to run in Jupyter Notebook in VSCode, it is not working.

    Please check whether you have chosen the correct Python kernel in Jupyter-Notebook.

    enter image description here

    The problem you meet may be caused by the python interpreter you selected in vscode was different from the kernel in jupyter.

    Read document for more details.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search