Hi,
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.
thanks
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.
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": [
"/home/chopan/miniconda3/envs/open-cv/lib/python3.10/site-packages",
"/home/chopan/miniconda3/envs/open-cv/lib/python3.10/site-packages/cv2"]
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.
thanks