libvips / pyvips

python binding for libvips using cffi
MIT License
636 stars 49 forks source link

Why is error 0x7f? #476

Open xyuechen opened 4 months ago

xyuechen commented 4 months ago

I'm trying to use pyvips but am having trouble running the sample. And my system is Windows 10.

When I "pip install pyvips" and "import pyvips", I get an error that says missing files, and I found the answer that download "vips-devs". Then I tried to add the environment variable and set “os[‘PATH’]” like I searched for, and next thing I know, the import works!

However, when I run the code, get an error " File "D:\happ\happy-main\happy\microscopefile\reader.py", line 10, in import pyvips File "C:\Users\Administrator\Anaconda3\envs\happy1\lib\site-packages\pyvips__init__.py", line 73, in vips_lib = ffi.dlopen(_vips_libname) File "C:\Users\Administrator\Anaconda3\envs\happy1\lib\site-packages\cffi\api.py", line 150, in dlopen lib, function_cache = _make_ffi_library(self, name, flags) File "C:\Users\Administrator\Anaconda3\envs\happy1\lib\site-packages\cffi\api.py", line 832, in _make_ffi_library backendlib = _load_backend_lib(backend, libname, flags) File "C:\Users\Administrator\Anaconda3\envs\happy1\lib\site-packages\cffi\api.py", line 828, in _load_backend_lib return backend.load_library(path, flags) OSError: cannot load library 'D:/happips-dev-8.10/bin\libvips-42.dll': error 0x7f python-BaseException"

Does the error occur in pyvips? Then I tried to rebuild my environment using Anaconda, but it doesn't work.

Thank you for your help with this! I look forward to using pyvips in python!

jcupitt commented 4 months ago

Hello @xyuechen,

I think that error means there's a 32/64-bit mixup.

I would install a 64-bit python from python.org and the 64-bit libvips binary. You can also try with anaconda and their libvips binary, but I've not tested that combination.