DARcorporation / xfoil-python

Stripped down version of XFOIL as compiled python module
GNU General Public License v3.0
88 stars 60 forks source link

[WinError 193] when initializing XFoil() #13

Open gmonechi opened 4 years ago

gmonechi commented 4 years ago

I am having an issue when initializing an XFoil object, after a successful installation of the package. Here is the error:

from xfoil import XFoil xf = XFoil() Traceback (most recent call last): File "", line 1, in File "C:\Users\Guido\anaconda3\envs\optCourse36\lib\site-packages\xfoil\xfoil.py", line 56, in init self._lib = cdll.LoadLibrary(self._lib_path) File "C:\Users\Guido\anaconda3\envs\optCourse36\lib\ctypes__init__.py", line 426, in LoadLibrary return self._dlltype(name) File "C:\Users\Guido\anaconda3\envs\optCourse36\lib\ctypes__init.py", line 348, in init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 193] %1 is not a valid Win32 application

Any idea what could be causing it? I have cmake and Mingw installed and in Path. The installation was successful both using pip install xfoil or from the Github repository, but always lead to the same error. I tried python versions 3.6, 3.7 and 3.8, always with the same result.

How can I fix it?

Thanks,

Guido

KikeM commented 4 years ago

Hi!

Here they suggest to reinstall Anaconda. Have you tried that?

https://stackoverflow.com/a/56638513

jannav84 commented 2 years ago

Hello, I have similar issue. It ends up with same error either I try it directly in Python console or in PyCharm environment: `Traceback (most recent call last): File "D:\Work\TAG\Flexwing_py\test.py", line 4, in xf = XFoil() File "C:\Users\navratil\AppData\Local\Programs\Python\Python310\lib\site-packages\xfoil\xfoil.py", line 56, in init self._lib = cdll.LoadLibrary(self._lib_path) File "C:\Users\navratil\AppData\Local\Programs\Python\Python310\lib\ctypes__init.py", line 452, in LoadLibrary return self._dlltype(name) File "C:\Users\navratil\AppData\Local\Programs\Python\Python310\lib\ctypes__init.py", line 374, in init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 193] %1 is not a valid Win32 application Exception ignored in: <function XFoil.del at 0x000001BEFFC377F0> Traceback (most recent call last): File "C:\Users\navratil\AppData\Local\Programs\Python\Python310\lib\site-packages\xfoil\xfoil.py", line 66, in del__ handle = self._lib._handle AttributeError: 'XFoil' object has no attribute '_lib'

Process finished with exit code 1`

Is there any way how to fix this issue?

Thanks, Jan