hkmoffat / cantera

Automatically exported from code.google.com/p/cantera
0 stars 0 forks source link

'Error using ctmethods' error with Matlab on Windows 7 - 64bit #148

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I followed the installation instructions for Cantera onto my PC (link below).
http://code.google.com/p/cantera/wiki/WindowsInstallation

I made sure I installed python 2.7.3 - 64 bit onto my PC. I set the environment 
variable path as directed in the above link. I also ran 'ctpath' in matlab 
prior to testing if Cantera worked.

When I try to test if Cantera works I keep getting the following error (between 
the #### lines below):

######################################################################
Error using ctmethods

***********************************************
                Cantera Error!
************************************************

Procedure: ct2ctml
Error:   Error executing python while converting input file:
Python command was: 'G:\virtualenv\py27-64\Scripts\python.exe'
exec_stream_t::start: CreateProcess failed.
 command line was: G:\virtualenv\py27-64\Scripts\python.exe -i
The system cannot find the file specified.

[code 0x0002 (2)]

Error in XML_Node (line 11)
    x.id = ctmethods(10,15,0,src); % newxml(name)

Error in Solution (line 30)
doc = XML_Node('doc',src);

Error in IdealGasMix (line 39)
            s = Solution(a);
#######################################################################

What do I need to do to get it working on my PC? 

Thanks in advance.

Original issue reported on code.google.com by derek.pa...@gmail.com on 8 Mar 2013 at 9:00

GoogleCodeExporter commented 9 years ago
A little more info, I also reinstalled NumPy and python 2.7.3 to make sure they 
were in properly. I haven't reinstalled Cantera yet...

Original comment by derek.pa...@gmail.com on 8 Mar 2013 at 9:02

GoogleCodeExporter commented 9 years ago
I think the problem is that you need to modify the ctpath.m file to point to 
the location of Python on your computer.

Original comment by yarmond on 9 Mar 2013 at 12:36

GoogleCodeExporter commented 9 years ago
This is the contents of ctpath, from the installer.  If the package is 
installed c:\Python27\python.exe

But what should the PYTHONPATH env variable be set to?

path('C:\Program Files\Cantera\matlab\toolbox', path)
path('C:\Program Files\Cantera\matlab\toolbox/1D', path)
setenv('PYTHON_CMD', 'G:\virtualenv\py27-64\Scripts\python.exe')
setenv('PYTHONPATH', [getenv('PYTHONPATH'), 
':C:\src\cantera\stage\lib\python2.7\site-packages'])

Original comment by ethan.ea...@gmail.com on 12 Mar 2013 at 9:13

GoogleCodeExporter commented 9 years ago
If you have Python installed in C:\Python27, then probably you should use:

    setenv('PYTHON_CMD', 'C:\Python27\python.exe')
    setenv('PYTHONPATH', 'C:\Python27\Lib\\site-packages'])

The installer doesn't know where you installed Python, so there's no way for it 
to generate a version of this file that is correct for your machine. The 
default values are just what happened to be the correct paths on the machine 
where the installer was created.

Original comment by yarmond on 12 Mar 2013 at 10:51

GoogleCodeExporter commented 9 years ago
Thanks, it works now!

Original comment by derek.pa...@gmail.com on 13 Mar 2013 at 5:23

GoogleCodeExporter commented 9 years ago

Original comment by yarmond on 13 Mar 2013 at 10:44