“DLL load failed” when import cv2 (opencv)

前端 未结 15 1010
萌比男神i
萌比男神i 2020-12-14 08:45

In [windows server 2012 R2 x64, python 3.7 64x]

pip install opencv-contrib-python

installed without any error .
and when I try to impor

相关标签:
15条回答
  • 2020-12-14 09:27

    After 15 days of brain storming, This solution worked for me. And I am sure that it will work for you too. I installed anaconda to use OpenCV 3.1.0. I followed following Steps:

    1) I have installed anaconda-5.3 64-bit installer (614.3 MB) which uses python 3.7. You can download anaconda from link: https://www.anaconda.com/download/#windows

    2) After installation of anaconda, open anaconda prompt by typing "anaconda prompt" on windows start button. Open with "Run as administrator".

    3) You have to create new environment to install and use OpenCV module.Write following commands to create and activate new environment:
    >conda create --name myNewEnv python=3.5.0
    >activate myNewEnv
    "myNewEnv" is the name of new enviroment.

    4)Now you need to install prerequisite for OpenCV, which is numpy and then install opencv3. Start internet before executing following commands:
    >conda install numpy
    >conda install anaconda-client
    >conda install --channel https://conda.anaconda.org/menpo opencv3

    5)OpenCV3 has been installed. Now, verify installation by executing following commands:
    (myNewEnv) C:\Users\Nilesh> python
    >>>import cv2
    >>>cv2.__version__

    Follow steps given below, when you want to start OpenCV3 second time onwards:

    1) Open "anaconda command promt" from start menu with "run as administrator" rights
    2) Type command >activate your_new_environment_name
    3) Assume that you want to run file located on desktop, for that write following command:
    > cd C:\Users\Nilesh\Desktop
    4) Now your working directory is Desktop.
    5) Type following command to run any code (for example test.py).
    > python test.py
    Note: Here, python means version-3.

    I hope this solution will work for you.

    0 讨论(0)
  • 2020-12-14 09:28

    It helps me pip install opencv-contrib-python Anaconda Prompt, python 3.7.1 cv2 4.1.1

    0 讨论(0)
  • 2020-12-14 09:29

    Installing Python version 3.6 and then installing opencv with the command: pip install opencv-python==3.3.0.9 resolved this issue for me

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