Loading...
Home / python run.py can't run

Home Forums Help python run.py can't run

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6136
    benedicttan88
    Participant

    Hi all,

    First of all i am very grateful to the authors of this project.
    I am trying to make this run but I seem to get stuck at Examples Python run.py line.

    (C:\Users\Benedict Tan\Anaconda3) C:\Engine-master\Engine-master\Examples\Example_1>python run.py

    1) Run ORE to produce NPV cube and exposures
    Traceback (most recent call last):
    File “run.py”, line 10, in <module>
    oreex.run(“Input/ore.xml”)
    File “..\ore_examples_helper.py”, line 184, in run
    subprocess.call([self.ore_exe, xml])
    File “C:\Users\Benedict Tan\Anaconda3\lib\subprocess.py”, line 267, in call
    with Popen(*popenargs, **kwargs) as p:
    File “C:\Users\Benedict Tan\Anaconda3\lib\subprocess.py”, line 707, in __init__
    restore_signals, start_new_session)
    File “C:\Users\Benedict Tan\Anaconda3\lib\subprocess.py”, line 990, in _execute_child
    startupinfo)
    FileNotFoundError: [WinError 2] The system cannot find the file specified

    I have already built ore.exe using quantlib and boost, and also installed the following packages in the anaconda prompt but got this error.
    Does anyone know how to fix this problem?

    Thank you!

    #6137
    Anonymous
    Inactive

    Hi,

    The file not found error is probably because it cannot find ore.exe, on windows this can often be a win32 vs 64 bit problem. If you look in ore_examples_helper.py you can see it looks for ore.exe on windows by

    if os.name == ‘nt’:
    if platform.machine()[-2:] == “64”:
    self.ore_exe = “..\\..\\App\\bin\\x64\\Release\\ore.exe”
    else:
    self.ore_exe = “..\\..\\App\\bin\\Win32\\Release\\ore.exe”

    First I’d check to see that these are in the correct directory, it should be looking for the 64 bit version by default, but this might be different on different versions of windows or python (i.e. by checking platform.machine()[-2:]). If you have one version built, but its picking up the wrong one, the simplest thing might be to edit ore_examples_helper.py.

    If you have ore built (32 or 64 bit) you can just run it manually from Examples_1 by doing
    ..\..\App\bin\x64\Release\ore Input\ore.xml

    This will produce the csv output files.

    Regards,
    Niall.

    #6143
    benedicttan88
    Participant

    Thank you very much!
    Sorry that I have not been able to reply, I have been busy lately and I tried the solution. It works perfectly.
    I will now take a look into the solutions and try to understand it from the examples.

    Is there some guide map to how to learn ORE works? something like the quantlib book.

    Regards
    Benedict

    #6144
    Anonymous
    Inactive

    Hi Benedict,

    That’s great.

    The best way to learn how ORE works is to first run a simple example and then step into that code to see what is going on, there is no guide as such just yet (QuantLib had to wait over 10 years before they had a book!)

    Regards,
    Niall.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.