Module name not found for cv2 - python

Currently, I'm using this to guide me with my project " https://github.com/hanyazou/TelloPy/blob/develop-0.7.0/tellopy/examples/video_effect.py "
but I have some issues running it, but to my knowledge, I believed I have cv2 installed in my PC. I'm using Windows 10-64bits if that helps..
The error was:
Traceback (most recent call last):
File "video_effect.py" , line 5, in module
import cv2.cv2 as cv2 # for avoidance of pylint error
ImportError: No module found cv2

Related

No module named 'face_recognition'

I installed cmake, dlib and face_recognition but when I run my project I get this error
Code:
import face_recognition
import cv2
Error:
Traceback (most recent call last):
File "...\face recognition\main.py", line 1, in <module>
import face_recognition
ModuleNotFoundError: No module named 'face_recognition'
Check if you've istalled dlif and etc under some virtual enviromant but trying to run your code under general one (or vise versa)

AttributeError: partially initialized module 'face_recognition' has no attribute 'face_encodings'

I am trying to make face recognition script in python with the help of below given link found on google.
https://www.mygreatlearning.com/blog/face-recognition/
I have installed:
OpenCV
dlib and
face_recognition
libraries.
Also, installed Visual C++ for CMake.
And now I am trying to "extract features from Face" using code given in above link.
While running script, I am getting below error:
Traceback (most recent call last):
File "C:\Users\ajay.arora2\AppData\Local\Programs\Python\Python38-32\extract_features_from_face.py", line 2, in <module>
import face_recognition
File "C:\Users\ajay.arora2\AppData\Local\Programs\Python\Python38-32\face_recognition.py", line 32, in <module>
encodings = face_recognition.face_encodings(rgb)
AttributeError: partially initialized module 'face_recognition' has no attribute 'face_encodings' (most likely due to a circular import)
I have tried re-installing face_recognition module.
Please suggest any workaround.
Thanks in advance.
Most probably you have named your file the same as the library "face_recognition".
Circular import happens when you want to import something from the same file.

Module is in correct folder, but still says that it cannot be found

I have pygame and numpy in the same folder. I can import pygame, but I can only import numpy in the terminal, not even in the IDLE. If I try to import numpy anywhere else, I get this message:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
I can also still import pygame into the terminal. Also, python in the terminal is version 3.7.5, but in the IDLE it's 3.6.6. Not sure if that's related.
All of my modules are in the default path folder.

from .cv2 import * ImportError: DLL load failed: The specified module could not be found

I used to play with opencv but now I am not able to use it. When I enter :
import cv 2
I get
import cv2
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import cv2
File "C:\Program Files\Python36-32\lib\site-packages\cv2\__init__.py", line 3, in <module>
from .cv2 import *
ImportError: DLL load failed: The specified module could not be found.
I have 32 bit Windows 7 and Python 3.6.
I had an issue that really looked like this one.
I installed OpenCV on an conda envrionement and someone had installed numpy unsing pip on the base environment.
Please check that:
all your installed package come from compatible sources
You don't have the same package installed twice
The only way that I could fix the issue was starting from a fresh environment.
Hope it helps

installing opencv for python without success

I followed this tutorial on how to install opencv on my mac (running 10.10.3). I also tried all of the suggestions listed in the stackoverflow post mentioned in the article.
When I run the line import cv the console returns:
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named cv
Does anyone have any suggestions as to what I can do to get opencv working?

Categories

Resources