简体   繁体   中英

cv2 and opencv Python troubleshooting install

I'm totally new to python. Currently I'm trying to install a packaged named cv2/openvc. Having migrated from Rstudio I'm trying to use rodeo in the same way for python. Python definitely seems less user friendly.

When I try to import the package from rodeo and I get following error:

在此处输入图片说明

However, when I run python from the windows cmd line and all works fine, I can even import cv2 and check the version.

在此处输入图片说明

Why is this and how can I fix it?

I can say the best thing you can do is to really know which python installation is being used by Rodeo. However, if you are in hurry you can install cv2 within the python interpreter by this code:

import sys
import subprocess
subprocess.call([sys.executable, "-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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM