简体   繁体   中英

Can't import cv2 from downloaded opencv library

I need to run a script which uses SIFT, with PyCharm. I must use the OpenCv 2.4.13, but I can't install previous version than OpenCV 3.x using the PyCharm package installer. So I downloaded the OpenCV 2.4.13 folder, put it in my project folder and created a new Virtualenv Environment, adding the path to the OpenCV folder to the Python interpreter for that Virtualenv Environment, but I still can't import cv2 getting the error "no module named cv2". What am I doing wrong?

Download the .whl file of the opencv version you need from here . And in the pycharm terminal run the command:

pip install "path to the downloaded wheel file"

However it seems opencv is only available for python 2.7 . You might have to switch python versions if you are using python 3.x

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