Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WinError 193] when initializing XFoil() #13

Open
gmonechi opened this issue Jun 4, 2020 · 2 comments
Open

[WinError 193] when initializing XFoil() #13

gmonechi opened this issue Jun 4, 2020 · 2 comments

Comments

@gmonechi
Copy link

gmonechi commented Jun 4, 2020

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

@emvalbuena
Copy link

Hi!

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

https://stackoverflow.com/a/56638513

@jannav84
Copy link

jannav84 commented Aug 1, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants