I have a single .py
file with nothing in it except import cv2
. When I run: pip install opencv-python
, it tells me that requirements are already satisfied but when I run it, it tells me there is "No module named cv2"
I'm using VSCode with Python 3.9.1
How could I solve this issue??
if you are using python 3 you should use
pip3 install package <name>
or pip install package as python 2X
you can try some different method here : https://java2blog.com/modulenotfounderror-no-module-named-cv2-python/
Your pip command may be connected to the python 3.7 because it works well when you change python interpreter.
python -V
python -m pip install opencv-python
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.