python - Opencv not recognized in vscode even though I downloaded in terminal - Stack Overflow

admin2025-04-28  2

When I try importing opencv on vscode it says 'no module found', when I try doing

pip install opencv2 

it says requirement already satisfied. I am a little confused on what to do, additionally, I had already downloaded opencv2 on my terminal.

I tried downloading within the vscode terminal rather than the windows one but it still doesnt work.

When I try importing opencv on vscode it says 'no module found', when I try doing

pip install opencv2 

it says requirement already satisfied. I am a little confused on what to do, additionally, I had already downloaded opencv2 on my terminal.

I tried downloading within the vscode terminal rather than the windows one but it still doesnt work.

Share Improve this question asked Jan 9 at 18:10 Krithik TamilselvanKrithik Tamilselvan 1
Add a comment  | 

2 Answers 2

Reset to default 0

If you want to use opencv in python try installation with this command

pip install opencv-python`

If you are using Run Code button to run the script than you need to select the interpreter. You can select interpreter from the status bar at the bottom of Vs Code. Or try to run the file using terminal.

python your_file_name.py

Try running your imports or code within a virtual environment

check out docs: https://docs.python.org/3/tutorial/venv.html

转载请注明原文地址:http://anycun.com/QandA/1745781557a91210.html