'Mac can import cv2 by vscode

I installed conda and vscode on my mac, then installed jupyter notebook, opencv, py-opencv etc.

My python version is 3.9, then I changed the 3.9 to 3.7 in case to install opencv and py-opencv.

Now, I can run import cv2 using jupyter(name.ipynb), but can not import formally python(name.py)

I checked the version on the terminal, the python version is 3.9, The conda environment is 3.7. I think that this is the problem.

but I do not have ideas to solve it.



Solution 1:[1]

Hello did you installed all packages inside conda environment using pip3?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dawid Szewc