Python calls BaiduFaceApi. DLL
import ctypes
dllBaiduFaceApi = ctypes.cdll.LoadLibrary("../x64/BaiduFaceApi.dll")
Error message:
Traceback (most recent call last):
File "<ipython-input-12-6f7ace0c1603>", line 1, in <module>
runfile('xxx/main.py', wdir='xxx')
File "x:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile
execfile(filename, namespace)
File "x:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "xxx/main.py", line 15, in <module>
dllBaiduFaceApi = ctypes.CDLL("../x64/BaiduFaceApi.dll")
File "x:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
The reason for the error is that baidufaceapi.dll relies on other DLLS in the X64 folder, but the Python process could not find it.
Solutions:
- modify the current working path:
os.chdir("../x64")
This approach is available in the Base environment of Anaconda, but not in the virtual environment.
- modify the system environment variable PATH, in which absolute PATH “(XXX /x64) “
is added
Read More:
- Error loading Python DLL ‘python36.dll’. LoadLibrary: The specified module could not be found.
- tensorflow import error: DLL load failed: The specified module could not be found (DLL load failed: The specified module could not be found)
- Tensorflow import error: DLL load failed: the specified module could not be found
- Oserror: [winerror 126] the specified module was not found. Pytoch couldn’t find caffe2_ detectron_ ops.dll
- OpenCV3.1 + Python2.7 error “DLL load failed: The specified module could not be found”
- self._handle = _dlopen(self._name, mode) OSError: [WinError126] The specified module could not found
- ImportError: DLL load failed: The specified module could not be found
- vscode import numpy error:DLL load failed: The specific module could not be found
- After tensorflow installation, an error occurred while importing: importerror: DLL load failed: the specified module could not be found
- ImportError: DLL load failed while importing xxx: The specified program could not be found.
- Python’s importerror: DLL load failed: the specified module was not found and the problem was solved
- Python import GDAL failed: DLL load failed. The specified module cannot be found.
- Importerror using tensorflow: DLL load failed: the specified program cannot be found
- DLL load failed: The specified procedure could not be found
- Sdl2 – importerror: DLL load failed: the specified module was not found.
- from ._ NNLS import NNLS importerror: DLL load failed: the specified module was not found.
- Finally solved the importError: DLLload failed: the specified module could not be found when import matplotlib.pyplot
- WCF-HTTP Error 404.17 – Not Found, The requested content appears to be script and will not be served…
- Win32ctypes. Pywin32. Pywintypes. Error: (2 ‘loadlibraryex’,’the system can’t find the specified file. ‘)
- Module not found: Error: Can’t resolve ‘./$$_gendir/app/app.module.ngfactory’