Error converting cti file to CTML

1,468 views
Skip to first unread message

Solal Amouyal

unread,
Aug 25, 2015, 5:43:26 AM8/25/15
to Cantera Users' Group
Hi,

I am using Cantera 2.0.1. My code compiles with no errors. When I run it, I get the following error:

terminate called after throwing an instance of 'Cantera::CanteraError'
  what():  
***********************************************************************
CanteraError thrown by ct2ctml:
Error converting input file "../input/GRI30.cti" to CTML.
Python command was: 'python'
The exit code was: 7
-------------- start of converter log --------------
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
ImportError: No module named ctml_writer
--------------- end of converter log ---------------
***********************************************************************

I have found some discussions reporting this problem but none of them contained a solution. Let me know if you have any suggestions. 
Would producing my own CTML file work? I tried doing using that tutorial but I could not get that to work either...

Steven C. Decaluwe

unread,
Aug 25, 2015, 7:15:45 AM8/25/15
to canter...@googlegroups.com
Hi Solal,

This is a pretty common installation error, which usually suggests that your system does not have the correct path to either the correct python interpreter or to ctml_writer.py.  Did you follow all instructions for installation, particularly as they relate to setting environment variables for the python path?

A quick google search for “cantera no module named ctml_writer” turns up a number of people who have previously run into this problem and how they have solved it (including discussions on this list). Most times, it looks like this error pops up when you have not correctly set the PYTHONPATH variable (I build from source on a mac, so I can’t necessarily verify, but the chances are pretty good).

Can you look back at the instructions and make sure that you have followed these particular steps?

Thanks,
Steven



----------------------------------------------------------
Steven DeCaluwe, Ph.D.
Assistant Professor of Mechanical Engineering
Colorado School of Mines
G. Brown Hall, W410 B
Golden, CO, 80401


--
You received this message because you are subscribed to the Google Groups "Cantera Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.
To post to this group, send email to canter...@googlegroups.com.
Visit this group at http://groups.google.com/group/cantera-users.
For more options, visit https://groups.google.com/d/optout.

Solal Amouyal

unread,
Aug 31, 2015, 8:13:08 AM8/31/15
to Cantera Users' Group
Hi Steven,

Sorry for the late reply I was never notified of your answer. 

Your answer actually did help me figure it out. I googled search "cantera no module named ctml_writer” like you suggested and one of the google groups forum helped me out. The "ctml_writer.py" was not in the python's "site_packages" directory. I did not have permission to write to it so I placed my "ctml_writer.py" file (obtained online) in another directory on my account and added that location to the environment variable PYTHONPATH. 

That fixed this issue. However, I was getting another error saying it could not find "elements.xml" in my local Cantera folder. I just had to locate it in the original Cantera folder and place it in my local one and my code ran successfully.

Thanks for your help!

Steven C. Decaluwe

unread,
Aug 31, 2015, 8:19:39 AM8/31/15
to canter...@googlegroups.com
Hi Solal,

I’m glad you got it figured out, and thanks for writing back with your solution - hopefully it will help somebody who encounters this problem, on a later date!

Cheers,
Steven

----------------------------------------------------------
Steven DeCaluwe, Ph.D.
Assistant Professor of Mechanical Engineering
Colorado School of Mines
G. Brown Hall, W410 B
Golden, CO, 80401


Zhongyuan Chen

unread,
Aug 8, 2016, 8:39:08 AM8/8/16
to Cantera Users' Group


在 2015年8月25日星期二 UTC+10下午7:43:26,Solal Amouyal写道:
Reply all
Reply to author
Forward
0 new messages