nucleic / kiwi

Efficient C++ implementation of the Cassowary constraint solving algorithm
https://kiwisolver.readthedocs.io/en/latest/
Other
693 stars 89 forks source link

ImportError: DLL load failed while importing _cext: %1 is not a valid Win32 application. #181

Open Spooyler opened 3 months ago

Spooyler commented 3 months ago

when trying to import matplotlib I got this error: ImportError: DLL load failed while importing _cext: %1 is not a valid Win32 application.

I am on 32 bit windows 10 with 32-bit python 3.8 installed. this the complete error: image

and these are all my packages installed: image

and finally the install folder for kiwisolver: image

I tried: -uninstalling and reinstalling many versions back until 1.0 -installing different versions of ms visual c++ redistrbutables -others python versions that are still compatible with the packages listed above

I checked and in theory, all my packages are compatible, and all wheels that I used are 32 bit compatible....so I don't know what I am doing wrong.

Spooyler commented 3 months ago

had a somewhat unelegant solution based on #28391 where I renamed the msvcp140-(here some sort of long garbage hash).dll in matplotlib.libs folder. now everything seems to work.

Qix- commented 3 months ago

all wheels are 32 bit compatible

Definitely not; they can be but there's nothing that mandates that. When you install kiwisolver, what's the name of the wheel that gets installed? For me on an x86_64 system, I get kiwisolver-1.4.5-cp39-cp39-win_amd64.whl, for example.

Spooyler commented 3 months ago

Edited initial post because it was misunderstandable. What I meant was all wheels I used are supposadly 32 bit compatible. this is was the name of the wheel was: kiwisolver-1.4.5-cp312-cp312-win32.whl

Qix- commented 3 months ago

Just downloaded the 3.8 wheel since you're on Python 3.8. It appears to be a valid DLL.

image

You can try manually installing the wheel here: https://files.pythonhosted.org/packages/1c/e1/597068727a76cbaf6aadb28882eb4d0ac48fed2e00a37e9f6cbbca5c24df/kiwisolver-1.4.5-cp38-cp38-win32.whl

What's strange is that you got cp312 which is for Python 3.12, but you're clearly on Python 3.8. Did you install Kiwi from a different Python installation?

Spooyler commented 3 months ago

No I have only one python version installed.

Spooyler commented 3 months ago

I tried the suggested wheel manually...same error if I reverse the manipulation I did with msvcp140.dll

Spooyler commented 3 months ago

I ended up rolling back on all packages to even earlier versions... now the issue is gone. Could have been some other incompatibility I couldn't figure out.