DARcorporation / xfoil-python

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

Error installing xfoil for python AttributeError: 'XFoil' object has no attribute '_lib' #15

Closed joshuaxdmb closed 3 years ago

joshuaxdmb commented 3 years ago

After working through all the other problems, I still have this error when trying to use Xfoil for python. I had it working before, but I am not sure how I did it (it was a long time ago, so it may have to do with packages being updated).

Here is the complete error message:

  File "d:/University of Toronto/FASE HPVDT - HPVDT 2020-2021/HPA 2020-2021/HPAProp/Github/marathon-aircraft/Prop/xrotor curves.py", line 23, in save_to_csv
    coeffs = foil.xfoil_aseq(a_start=-7,a_end=10,a_step=0.25, max_iter = 500, repanel = True, reset_bls = True, n_crit=n_crit, M=0,Re=Re) #Sweep through alphas
  File "D:\ProgramsD\Anaconda3\lib\site-packages\aerosandbox\geometry\airfoil.py", line 781, in xfoil_aseq
    xf = XFoil()
  File "D:\ProgramsD\Anaconda3\lib\site-packages\xfoil\xfoil.py", line 56, in __init__
    self._lib = cdll.LoadLibrary(self._lib_path)
  File "D:\ProgramsD\Anaconda3\lib\ctypes\__init__.py", line 451, in LoadLibrary
    return self._dlltype(name)
  File "D:\ProgramsD\Anaconda3\lib\ctypes\__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\joshu\AppData\Local\Temp\tmp8aszb9n1.dll' (or one of its dependencies). Try using the full path with constructor syntax.
Exception ignored in: <function XFoil.__del__ at 0x000002C321A5ED30>
Traceback (most recent call last):
  File "D:\ProgramsD\Anaconda3\lib\site-packages\xfoil\xfoil.py", line 66, in __del__
    handle = self._lib._handle
AttributeError: 'XFoil' object has no attribute '_lib'

I already tried reinstalling OpenSSL in all possible ways.

Thanks for any help.

joshuaxdmb commented 3 years ago

@peterdsharpe I know you have been dealing with this library, I'd appreciate any input here.

joshuaxdmb commented 3 years ago

I found it does work with Python3.7 for some reason, but not Python3.8 (what I was using). 😄