No module named 'cv2.cv2'

前端 未结 5 774
刺人心
刺人心 2021-01-18 17:30

I am a beginner at computers. I use Anaconda python 3.6 in windows 10. I have already installed OpenCV using this command:

         


        
相关标签:
5条回答
  • 2021-01-18 17:50

    In my case, using Python 3.8 on Windows 10 and Pycharm (or VS Code as well), I have this same issue.

    Finally I noticed that the Antivirus (Nod32) deletes the cv2.cp38-win32.pyd file that should be in the cv2 folder. I simply paused the protection, installed opencv with pip install opencv-python command and it worked just fine.

    I hope it helps someone.

    0 讨论(0)
  • 2021-01-18 17:51

    Based on python opencv link: https://pypi.org/project/opencv-python/

    Step 1: Uninstall the opencv first if you have previous/other manually installed (= not installed via pip) version of OpenCV installed (e.g. cv2 module in the root of Python's site-packages)):

    pip uninstall opencv-python

    Step 2: Install the package afresh

    pip install opencv-python

    Hope that works!

    0 讨论(0)
  • 2021-01-18 18:05

    try this:

    Create Virtual Environment

    conda create --name opencv-env python=3.6
    

    Activate the environment

    activate opencv-env
    

    Install OpenCV and other important packages

    pip install numpy scipy matplotlib scikit-learn jupyter
    pip install opencv-contrib-python
    pip install dlib
    

    Test your installation

    import cv2
    cv2.__version__
    
    0 讨论(0)
  • 2021-01-18 18:09

    I had this exact same problem on Windows 10. Uninstalling via pip and then reinstalling in my virtual environment fixed everything up for me.

    Here's a link that helped https://pypi.org/project/opencv-python/

    0 讨论(0)
  • 2021-01-18 18:14

    I used the answer provided here and it worked.

    By running pip install opencv_python-3.4.5-cp36-cp36m-win_amd64.whl

    0 讨论(0)
提交回复
热议问题