I often use python in VScode. However, after two VScode updates, the import function (cv or numpy) is not working. I’ve tried using the shift+command+p
and > python select interpret
e but none are working for these functions.
I tried use > pip install pylint
but it didn’t work.
How can I solve this problem? Has someone the same problem in VScode?
2
Answers
Steps I would suggest to follow:
hope this helps.
It is recommended to use a virtual environment to manage third-party packages and python versions more conveniently.
Create a virtual environment with the following command
After the command is completed, select the virtual environment interpreter just created in the Select Interpreter panel
The new terminal can automatically activate the environment
Now there is no package installed in the new virtual environment, and an error occurs
Install the
cv2
package in the new environment, and the error disappeared after installing the package