Getting this error *** OSError: cannot load library C:\WINDOWS\libzsfc.dll: error 0xc1 - python-2.7

I am trying to load a .dll file using python cffi library, but whiele I am trying to load it I am getting following error:-
*** OSError: cannot load library C:\WINDOWS\libzsfc.dll: error 0xc1
I am using this
from cffi import FFI
ffi = FFI()
lib = ffi.dlopen("libzsfc.dll")
but this giving me error, I tried a lot to resolve this, but it remains same, please let me know if anyone faced same issue.

I think you have to first register the dll in windows then load will work fine.
To register the same use command regsvr32 <complete dll path>
Use Regsvr32.exe from the %SystemRoot%\Syswow64 folder. For example, type the following commands to register the DLL: cd \windows\syswow64 regsvr32 c:\filename.dll

Old question, but I just had the same issue. Fixed:
Super easy - reinstall tessaract. Head over to https://github.com/UB-Mannheim/tesseract/wiki. Get their installer. It'll have you uninstall the old version. Worked immediately for me.

Related

No module named 'numpy.core._multiarray_umath'

I am trying to use matploitlib_cpp on Windows 11 with Numpy 1.24.2 and Python 3.11, but I keep running in to the following error.
Original error was: No module named 'numpy.core._multiarray_umath'
I know this has been posted at a million different places on the internet and I have tried following all the guides that says reinstalling numpy and whatever, it does not work for me. What I can see in my path ..\Python3.11\Lib\site-packages\numpy\core is that I have a file named _multiarray_umath.cp311-win_amd64.pyd but no file named _multiarray_umath. I also tried to use a virtual environement from Anaconda but I am not sure how to build matploitlib_cpp against such virtual enviornment.
I got it working by using the release binaries instead of debug binaries.

How to prevent ctypes.CDLL("jvm.dll") giving "module not found" error on Windows Server 2016?

How do we get ctypes.CDLL("jvm.dll") to not find the dll and not give a "module not found" error?
We have verified the paths and can get them through file "open" commands of the jvm.dll - but the exact same paths when given to ctypes gives a "module not found" error.
We also tried editing the registry keys as per this answer.
We have also tried both running a 32 bit version of Python with a 32 bit version of Java as well as trying 64 bit versions.
We are working in Python 2.7.14 on Windows Server 2016.
Why could this be failing and what else can we try? Is there something preventing the Python script from seeing DLLs?
Here is more background:
The reason we are trying to get ctypes to work is because jpype is failing with the same error- and thus they seem foundationally related to the Python modules not being able to see or access the DLL.
When we run the following commands...
>> import ctypes
>> import os
>> os.chdir(r"C:\Program Files (x86)\Java\jre1.8.0_181\bin\client\")
>> ctypes.CDLL("jvm.dll")
...we get "module not found."
Yet, we can reach the file with open commands. For example, this call works from within Python (note it also works for the x86 path used above) to reach the jvm.dll:
>>> fo = open("C:\\Program Files\\Java\\jre1.8.0_181\\bin\\server\\jvm.dll")
But this call via Jpype fails even though is pathed to the same file:
>>> import jpype
>>> jpype.startJVM("C:\\Program Files\\Java\\jre1.8.0_181\\bin\\server\\jvm.dll")
Jpype gives the following error:
File "C:\Python27\lib\site-packages\jpype_core.py", line 70, in
startJVM
_jpype.startup(jvm, tuple(args), True) RuntimeError: Unable to load DLL [C:\Program Files\Java\jre1.8.0_181\bin\server\jvm.dll],
error = The specified module could not be found. at
native\common\include\jp_platform_win32.h:58
The reason we are using jpype is we are trying to get Jaydebeapi working to create a JDBC connection to a database.
How do we enable ctypes (and presumably thus jpype) to find and use the jvm.dll?
Our answer to solving this was to move from using the Python 2.7 interpreter to using Jython.
Using Jython, we were able to use the Jadebeapi library and connect to the database over JDBC.

GHCi could not load .dll lib (C++ lib) on Windows

I've installed a C++ lib successfully via vcpgk, named: lmdb:x64-windows
I also installed lmdb binding package for Haskell by Cabal install
And when trying to test the lmdb package:
module Persistence where
import Database.LMDB.Raw
GHCi compiled and loaded it:
[1 of 1] Compiling Persistence ( Persistence.hs, interpreted )
Ok, modules loaded: Persistence.
But it throws error when I try to call any functions in lmdb Raw lib:
*Persistence> lmdb_version
ghc.exe: addDLL: lmdb.dll (Win32 error 126): The specified module could not
be found.
ghc.exe: Could not load `lmdb.dll'. Reason: addDLL: could not load DLL
ghc.exe: C:\Users\thanhdo\AppData\Roaming\cabal\x86_64-windows-ghc-
8.0.2\lmdb-0.2.5-1uQhV16mebP51rtMgitOcY\HSlmdb-0.2.5-
1uQhV16mebP51rtMgitOcY.o: unknown symbol `mdb_dbi_close'
ghc.exe: unable to load package `lmdb-0.2.5'
I was searching around and was trying several approaches but still can't resolve this error. I'm using Windows 7 64bit, Haskell platform 8.0.2. Thanks in advance.
As per discussion in comment section, I was trying to tell GHCi the location of lmdb's dll. It works after I modify %path% env.
In my case, the path was: vcpkg\installed\x64-windows\bin

Bundled executable crashes without warning when rendering plots

(I have already resolved this issue but it cost me two weeks of my time and my employer a couple of grand, so I'm sharing it here to save some poor soul.)
My company is converting our application from 32-bit to 64-bit. We create an executable using py2exe, using the bundle=2 option. The executable started crashing as soon as it tried to render a matplotlib plot.
Versions:
python==2.7.13,
matplotlib==2.0.0,
numpy==1.13.1,
py2exe==0.6.10a1
I tracked the error to the numpy library. Numpy calls numpy.linalg._umath_linalg.inv() and the program abruptly exits with no error message, warning, or traceback.
_umath_linalg is a .pyd file and I discovered that this particular .pyd file doesn't like being called from library.zip, which is where py2exe puts it when using bundle option 2 or 1.
The solution is to exclude numpy in the py2exe setup script and copy the entire package folder into the distribution directory and add that directory to the system path at the top of the main python script.

SimpleCV 1.3 is not

I just install SimpleCV 1.3 on Windows 7. During the install I got a message: "this program could not have been correctly installed setuptools-0.6c11.win32-py2.7.exe". When I run the first example
>>> logo = Image("simplecv")
>>> logo.show()
I got an empty python window and I get a warning: "You need the python image library to save by filehandle"
Someone knows how to fix this?
thanks in advance
After the install error message, did you try reinstalling?
SimpleCV is supposed to include all the libraries it needs, so when installation failed it must have missed some libraries.
You could try installing the python image library (PIL) yourself.
I usually use this web site as a source of python libraries: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil (I think you should use Pillow-2.0.0.win32-py2.7.‌exe)