Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: DLL load failed while importing cv2: The specified module could not be found. #976

Open
NajetMed opened this issue Apr 26, 2024 · 1 comment

Comments

@NajetMed
Copy link

Expected behaviour

I'am trying to run a cod about document classification and I got this error i try to install the library via Anaconda but doesn't exist.
import pandas as pd
import numpy as np
import tensorflow as tf
import string
import nltk
import pathlib
import os
import cv2
import matplotlib.pyplot as plt
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.metrics import TruePositives, FalsePositives, TrueNegatives, FalseNegatives, BinaryAccuracy, Precision, Recall, AUC

@imSanko
Copy link

imSanko commented Apr 28, 2024

Install OpenCV using Anaconda:

  • Open the Anaconda Prompt or Anaconda PowerShell.
  • Run the following command to create a new virtual environment (replace env_name with the desired name for your environment):

If the installation is successful, you should be able to import the cv2 module without any issues.

  1. Install OpenCV using pip:
    If the Anaconda approach doesn't work, you can try installing OpenCV using pip.

    pip install opencv-python
    

This command will install OpenCV and its dependencies using pip.

  1. Check the installation path:
    If you have multiple Python installations or environments on your system, make sure that you are importing the cv2 module from the correct environment or installation path.

  2. Try Reinstall OpenCV:
    If the above steps don't work, you can try uninstalling and reinstalling OpenCV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants