Importing the library

im working in vs code and i have to import the library as cv2.cv2 for intellisense to autocomplete the code. But im working with a team and they all just use cv2 to import it. Can you help me figure out how to make so that importing is as cv2 makes intellisense work.

present how you installed everything. mention every “complication”. that means, if you used any virtual envs or dockers or WSL or any of that, you need to say so. that also includes anything I am not explicitly asking about. if your computer is cursed, I can’t anticipate that.

also… please look on the internet. you aren’t the first with that problem. solutions are out there. you’re only making me google for you. that’s a waste of everyone’s time.

1 Like

I’m sorry for the lack of information.
I’m working on ubuntu 20.04. i’m using conda, i have created a virtual enviroment using python 3.10. I have installed numpy and opencv-python using pip. I’ve created the path to the site-packages folder as follow:

"python.autoComplete.extraPaths": [

Every thing works perfectly fine. But i have to include the opencv library using the following line:

import cv2.cv2 as cv

for the library to work properly. if i don’t do that the interpreter won’t find the library. But i work with and the import it as:

import cv2 as cv

and it works for them like that.

my question is how can a make it so i can import the library as all my team member do? I am sorry if that is a trivial question but i’m new to python and opencv.