I am trying to load in an image from the same folder as the one my python script is in - python

C:\Users\Developer\AppData\Local\Programs\Python\Python39\python.exe D:\PHD\PycharmProjects\face_Detect_1\main.py
Traceback (most recent call last):
File "D:\PHD\PycharmProjects\face_Detect_1\main.py", line 5, in
from PIL import Image, ImageTk
File "C:\Users\Developer\AppData\Roaming\Python\Python39\site-packages\PIL\Image.py", line 103, in
from . import _imaging as core
ImportError: DLL load failed while importing _imaging: The specified procedure could not be found.
please help me
Thank you in advance for the help!

Related

Unable to open shape_predictor_68_face_landmarks.dat for face recognition

I have a project where I'll use the face_recognition library to recognise faces in Images. I tried the following code to make sure if the library is working:
from PIL import Image
import numpy as np
import face_recognition
obama_image = face_recognition.load_image_file("obama.jpg")
But I get the following error:
Traceback (most recent call last):
File "test.py", line 3, in <module>
import face_recognition
File "C:\Users\علي\AppData\Roaming\Python\Python38\site-packages\face_recognition\__init__.py", line 7, in <module>
from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
File "C:\Users\علي\AppData\Roaming\Python\Python38\site-packages\face_recognition\api.py", line 20, in <module>
pose_predictor_68_point = dlib.shape_predictor(predictor_68_point_model)
RuntimeError: Unable to open C:\Users\علي\AppData\Roaming\Python\Python38\site-packages\face_recognition_models\models\shape_predictor_68_face_landmarks.dat
I tried some sulotions that I found but nothing worked.
I downloaded dlib library in the proper way.
I redownloaded the file shape_predictor_68_face_landmarks.dat.
I tried to copy the file to the directory of my python file, but still not working.
Thanks in advance

DLL Load Failure

I should clarify that I am a bit unfamiliar with code and I am just trying to run someone else's script.
I am trying to run it by typing 'python potatoFarmer.py' and it has 2 lines before it has an error, here is what it looks like.
Traceback (most recent call last):
File "potatoFarmer.py", line 1, in from wizAPI import *
File "C:\Users\PC\Desktop\Setups\Py Script\wizAPI-master\wizAPI.py", line 1, in
import win32gui
ImportError: DLL load failed: The specified module could not be found.
Any help would be great, thank you!

How to install wxPython for ubuntu 20.04.4

Im trying to install wxpython for my linux computer and having great difficulty. I can see in my packages folder I have a folder called wx but when i go to import it in python I get the following error message:
[Traceback (most recent call last):
File "", line 1, in
File "/home/db/.local/lib/python3.8/site-packages/wx/init.py", line 17, in
from wx.core import *
File "/home/db/.local/lib/python3.8/site-packages/wx/core.py", line 12, in
from ._core import *
ImportError: libSDL2-2.0.so.0: cannot open shared object file: No such file or directory]
Any help on how to solve this problem would be greatly appreciated!
Thanks in advance

Import error:DLL load failed:The specific module could not be found

I am trying to execute handtracking module program,but I am getting this dll error while trying to import handtracking module
Program code:
import cv2
from cvzone.HandTrackingModule import HandDetector
detector=HandDetector(detectionCon=0.8)
cap =cv2.VideoCapture(0)
cap.set(3,1080)
cap.set(4,720)
while True:
sucess,img=cap.read()
img=detector.findHands(img)
lmlist,bboxinfo=detector.findPosition(img)
cv2.imshow('video',img)
cv2.waitKey(1)
Error I am getting:
Traceback (most recent call last):
File "C:/Users/Vignesh/Desktop/opencvproject/sagarmouse.py", line 3, in <module>
from cvzone.HandTrackingModule import HandDetector
File "C:\Python37\lib\site-packages\cvzone\HandTrackingModule.py", line 8, in <module>
import mediapipe as mp
File "C:\Users\Vignesh\AppData\Roaming\Python\Python37\site-packages\mediapipe\__init__.py", line 16, in <module>
from mediapipe.python import *
File "C:\Users\Vignesh\AppData\Roaming\Python\Python37\site-packages\mediapipe\python\__init__.py", line 17, in <module>
from mediapipe.python._framework_bindings import resource_util
ImportError: DLL load failed: The specified module could not be found.
Process finished with exit code 1
Did you add the required dll to your environment? If not you may add the dll to your path and restart your working environment.
You should uninstall mediapipe and install it again.
If it is not working still you should type in your terminal pip install msvc-runtime to avoid the error.
If want any other version, you visit
there ===> https://pypi.org/project/msvc-runtime/#history
Thanks.

Python to read text from picture giving some import package errors

Unable to read text from a picture using PIL and pytesseract
import PIL
from PIL import Image
import pytesseract
im = PIL.Image.open('C:\\Users\\Edgar.Lizarraga\\Desktop\\Kaizen-Continuous-Improvement-Model.png')
x = pytesseract.image_to_string(im)
print(x)
giving me the following message:
Traceback (most recent call last):
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
from . import multiarray
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/Edgar.Lizarraga/PycharmProjects/Pic2/pic2.py", line 3, in <module>
import pytesseract
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\pytesseract\__init__.py", line 1, in <module>
from .pytesseract import (
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\pytesseract\pytesseract.py", line 27, in <module>
from numpy import ndarray
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Users\Edgar.Lizarraga\AppData\Local\Continuum\anaconda33\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: The specified module could not be found.
I'm not sure if this could cause the issue but you should't need to import both PIL and PIL.Image.
Would comment this but I don't have 50 rep.

Categories

Resources