1

我的问题和这里的一样。

模块对象没有属性 [CANTERA]

Ray Speth 发表了评论,但该帖子的 OP 从未回复,所以我希望 Ray 也许可以帮助我。

我安装了 Cantera 并尝试通过以下方式制造气体

import cantera as ct
gas1 = ct.Solution('gri30.xml')

我得到了错误

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Solution'

我按照评论的建议做了,得到了以下输出

print(ct.__file__)
/usr/local/lib/python2.7/site-packages/cantera/__init__.py

print(ct.__version__)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute '__version__'
4

1 回答 1

0
  • 检查 Python 和 Cantera 的版本和兼容性。
  • 此外,检查您的机制文件是否正确合并(用于制作 .cti 文件的热和动力学文件)。
于 2018-12-17T21:09:01.450 回答