Issue
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?
Solution
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
python -m venv myenv
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
Answered By - JialeDu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.