Closed GoogleCodeExporter closed 9 years ago
Based on these lines:
File "C:\Python33\lib\site-packages\numpy\core\__init__.py", line 6, in <module>
from . import multiarray
ImportError: DLL load failed: %1 is not a valid Win32 application.
it seems to be a problem loading Numpy. According to this post on StackOverflow:
http://stackoverflow.com/questions/11404269/numpy-importerror-in-python-dll-load
-failed
the problem may be that your Numpy is 32-bit, while the rest of the software is
64-bit. Can you check that?
Bryan
Original comment by bryan.w....@gmail.com
on 10 Mar 2014 at 1:41
You can get a binary installer version of Numpy from here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
Original comment by bryan.w....@gmail.com
on 10 Mar 2014 at 1:42
Tobi,
How did you install Numpy, and what version do you have? What is the result of
running the following commands in Python?
>>> import sys; print(sys.version)
>>> import numpy
>>> print(numpy.__version__)
If you get an error on importing Numpy, try the installer from the site Bryan
linked to.
Original comment by yarmond
on 11 Mar 2014 at 2:16
Thanks Bryan and Yarmond.
I reinstalled Numpy. I am currently able to run the program from matlab as an
admin.
Running from matlab without the administrator priviledges results in this error
when I enter Solution('nasa_gas.cti') into the command line
Error using ctmethods
************************************************
Cantera Error!
************************************************
Procedure: ct2ctml
Error: Error converting input file "C:/Users/air/Documents/data/nasa_gas.cti"
to CTML.
Python command was: 'C:\Python33\python.exe'
The exit code was: 7
-------------- start of converter log --------------
Traceback (most recent call last):
File "<stdin>", line 8, in <module>
File "C:\Python33\Lib\site-packages\cantera\ctml_writer.py", line 2597, in convert
write(outName)
File "C:\Python33\Lib\site-packages\cantera\ctml_writer.py", line 338, in write
x.write(_name+'.xml')
File "C:\Python33\Lib\site-packages\cantera\ctml_writer.py", line 133, in write
with open(filename, 'w') as f:
PermissionError: [Errno 13] Permission denied: 'nasa_gas.xml'
--------------- end of converter log ---------------
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);
I can now import numpy and cantera from python
however I get this error if I run cantera.Solution('nasa_gas.cti')
>>> import cantera
>>> cantera.Solution('nasa_gas.cti')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "base.pyx", line 30, in cantera._cantera._SolutionBase.__cinit__ (cantera/_cantera.cpp:5652)
ValueError: Couldn't read phase node from XML file
If I run python as an admin, I get the following error running the same code in
powershell
Python 3.3.4 (v3.3.4:7ff62415e426, Feb 10 2014, 18:13:51) [MSC v.1600 64 bit (AM
D64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cantera
>>> cantera.Solution('nasa_gas.cti')
get_CTML_Tree: caught an exception:
***********************************************************************
CanteraError thrown by ct2ctml:
Error converting input file "C:\Users\air\Documents\data/nasa_gas.cti" to CTML.
Python command was: 'C:\Python33\python.exe'
The exit code was: 7
-------------- start of converter log --------------
Traceback (most recent call last):
File "<stdin>", line 8, in <module>
File "C:\Python33\Lib\site-packages\cantera\ctml_writer.py", line 2597, in con
vert
write(outName)
File "C:\Python33\Lib\site-packages\cantera\ctml_writer.py", line 338, in writ
e
x.write(_name+'.xml')
File "C:\Python33\Lib\site-packages\cantera\ctml_writer.py", line 133, in writ
e
with open(filename, 'w') as f:
PermissionError: [Errno 13] Permission denied: 'nasa_gas.xml'
--------------- end of converter log ---------------
***********************************************************************
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "base.pyx", line 21, in cantera._cantera._SolutionBase.__cinit__ (cantera
/_cantera.cpp:5594)
RuntimeError:
***********************************************************************
CanteraError thrown by get_CTML_Tree:
XML file ./nasa_gas.xml not found
***********************************************************************
Indicating an issue with file permissions, similar to running matlab without
admin priviledges. I'm looking through similar posts for solutions.
Original comment by t.air4u...@gmail.com
on 12 Mar 2014 at 5:25
The following error when trying to import nasa_gas.cti is expected in all cases:
ValueError: Couldn't read phase node from XML file
because that file only contains species definitions to be used by other input
files. I'm not sure where the idea that importing nasa_gas.cti directly should
work comes from. If you import an input file with a phase definition, e.g.
h2o2.cti, you should not get this error.
The permissions errors are exactly what they say they are: You need write
access to the current working directory so that Cantera can save the converted
.cti file. This is not a problem with Cantera.
Original comment by yarmond
on 13 Mar 2014 at 12:55
Original comment by yarmond
on 13 Mar 2014 at 12:56
I have a similar error appearing. This is Cantera 2.1.x, and the setup_cantera
calls python2.7. Numpy is happily installed, version 1.9.0.
Running from matlab I get :
>>gas1=GRI30
Procedure: ct2ctml
Error: Error converting input file
"/usr/local/Cellar/cantera/2.1.x/share/cantera/data/gri30.cti" to
CTML.
Python command was: '/usr/local/bin/python'
The exit code was: 7
-------------- start of converter log --------------
Traceback (most recent call last):
File "<stdin>", line 7, in <module>
ImportError: No module named ctml_writer
--------------- end of converter log ---------------
Running from python works fine.
Ideas?
Original comment by Simone.H...@gmail.com
on 14 Oct 2014 at 4:14
Original issue reported on code.google.com by
t.air4u...@gmail.com
on 9 Mar 2014 at 2:20