problem when running .py file

Tingting HAN hihighsky at gmail.com
Fri Apr 23 17:43:41 EDT 2010


Dear Officer,

I first apologize that I am totally new for python. I have downloaded a code
packet “triMC3D” from online, and within it there is a file
“configuration.py”.I downloaded and installed python and some related
packages, tried very hard, but there is still the following error:



the  Traceback (most recent call last):
  File "E:\TingTing\triMC3D-1.0.0\python\configuration.py", line 8, in ?
    from tables import *
  File "C:\Python23\Lib\site-packages\tables\__init__.py", line 31, in ?
    from tables.utilsExtension import getPyTablesVersion, getHDF5Version
ImportError: DLL load failed: The specified procedure could not be
found. The first attached



The system of my computer is Windows XP.

The first attached file is the README file for triMC3D code. It says they
used python 2.3 so I used the version python-2.3.5.

The second attached is the file “configuration.py” I want to run. I
sincerely hope that you could try to run it, see what is the problem and
give me some tips.


-- 
Best regards,
Sofia

ETSI de Telecomunicación - office C-203-1
Dpto. Ingeniería Electrónica
Ciudad Universitaria s/n
Madrid 28040,  Spain
TEL: +34 65 232 4340
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100423/665ab768/attachment.html>
-------------- next part --------------
triMC3D
------ 

Monte Carlo simulation environment for heterogeneous turbid media. The
geometry is described by a triangle mesh, which allows for computation
of reflection/refraction effects at different tissue layers.

Features:
	* Arbitrary geometries importable from STL format.
	* Easy generation of analytical shapes using python
	* Calculation of light fluence/absorbance whithin the medium. 
	* Calculation and storage of photon paths with time-resolved information.
	* HDF5 format for neat data input and output.
TODO:
	* Optimize the spatial organisation of triangles.
	* Hardware acceleration of ray-triangle intersection functions.
	* Introduction of new phase functions.
	* Addition of more source functions.
	* Incorporation of polarisation handling

Compilation
-----------
triMC3D depends on several libraries in order to be built:

	* libhdf5 and libhdf5_hl
	* libgsl
	* an MPI implementation, like mpich2, in order to compile the
parallel version

Furthermore, python 2.3 and packets pytables, scipy, VTK and numarray/numpy are
extensively used for model preparation and post-processing of simulation data.

Usage
-----
There are several options in order to deal with input and output files
for triMC3D (HDF5 data format). Among the programs and libraries that
can be used to this end, the following are probably most useful:

	* Python + PyTables
	* Matlab + HDF5 access library
	* IDL + HDF library
	* HDFview
	* HDF tools from NCSA	
	* Paraview for fast data visualisation

-------------- next part --------------
#!/usr/bin/python
"""Add a configuration entry to the parameters"""
import sys
import array
import struct
import math
import numarray
from tables import *

from local_modules import hdf5


def create_config(file_id):
    try:
        table = file_id.root.Configuration
    except Exception:
        table = file_id.createTable(file_id.root, 'Configuration',
                                    hdf5.Configuration, "Simulation Parameters")
    c1 = table.row

    c1["idnumber"]   = 1
    c1["num_phots"]  = 1000
    c1["descr"]      = "Background Illumination"
    c1["bin_size"]   = 2e-4
    c1["out_file"]   = "outtest.h5"
    c1["src_type"]   = "gaussian"
    c1["src_dir"]    = (0, 0, 1)
    c1["src_pos"]    = (0, 0,-2.1e-3 )
    c1["sim_type"]   = hdf5.sim_types["Incoherent"]
    c1["extra_params"] = 0

    c1.append()
    table.flush()
    
def create_extra(file_id):    
    try:
        table = file_id.root.EXTRAParams
    except Exception:
        table = file_id.createTable(file_id.root, 'EXTRAParams',
                                    hdf5.EXTRAParam, "EXTRA Parameters")
    p1 = table.row
    p1["idnumber"]   = 0
    p1["mode"]       = hdf5.extra_modes["Limited"]
    p1["Li_limit"]   = 5
    p1.append()
    table.flush()

def main():
    if len(sys.argv) <> 2:
        print( "Usage: " + sys.argv[0] + "H5file.h5")
        sys.exit(1)
        
    file_id = openFile(sys.argv[1],mode = "r+")


    create_config(file_id)
    create_extra(file_id)

if __name__ == "__main__":
    main()


More information about the Python-list mailing list