“X箔”对象没有属性“_lib”;
你好,我正在尝试使用 python 来使用 Xfoil 包。正如说明所示,我安装了该软件包并编写了以下几行,这些行也作为简单示例显示在文档中。但是,在第二行 xf=XFoil() 中运行它时我总是收到错误,错误是 AttributeError:“XFoil”对象没有属性“_lib” 感谢您的任何建议
from xfoil import XFoil
xf = XFoil()
from xfoil.test import naca0012
xf.airfoil = naca0012
xf.Re = 1e6
xf.max_iter = 40
a, cl, cd, cm = xf.aseq(-20, 20, 0.5)
import matplotlib.pyplot as plt
plt.plot(a, cl)
plt.show()
Hello I'm trying to use Xfoil package using python. As the instructions say I installed the package and have written the following lines which are also shown in the documentation as a simple example. But, I always get error when running it in the second line xf=XFoil() and the error is
AttributeError: 'XFoil' object has no attribute '_lib'
Thanks for any suggestions
from xfoil import XFoil
xf = XFoil()
from xfoil.test import naca0012
xf.airfoil = naca0012
xf.Re = 1e6
xf.max_iter = 40
a, cl, cd, cm = xf.aseq(-20, 20, 0.5)
import matplotlib.pyplot as plt
plt.plot(a, cl)
plt.show()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的错误。我使用 python 3.7.13 在 Windows 操作系统中安装了 xfoil。导入
from xfoil import XFoil
工作正常,但是正如您提到的xf = XFoil()
导致属性错误。我尝试了 Github 页面 中给出的安装指南,效果很好。为了简洁起见,我复制粘贴了以下指南:在
PYTHONPATH\Lib\distutils
中创建一个名为distutils.cfg
的文件,其中包含以下内容:我希望有所帮助。
I got the same error. I installed xfoil in my windows OS with python 3.7.13. The import
from xfoil import XFoil
worked fine however as you mentionedxf = XFoil()
resulted in an attribute error. I tried the installation guidelines given in the Github page and that worked fine. For brevity I have copy pasted the guidelines below:create a file named
distutils.cfg
inPYTHONPATH\Lib\distutils
with the following contents:I hope that helps.