Author Topic: Error running pyxll with Parallel Python  (Read 761 times)

arpit.mathur

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Error running pyxll with Parallel Python
« on: September 13, 2013, 03:37:02 AM »
Hi,

I recently installed pyxll and was trying to use it to display output on the excel sheet.

The main calculation function is parallelized using Parallel Python (PaPy) and it runs fine.
I then tried to display this output onto excel by writing a macro (with decorator xl_macro) which calls this function and displays its output.

When the macro calls the function and tries to create a job server (in PaPy), it instead opens up another window of excel and then it freezes (and has to be killed).

Is this a known problem and it there a way to get around this?

Thanks


Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
  • Karma: +13/-1
    • View Profile
Re: Error running pyxll with Parallel Python
« Reply #1 on: September 13, 2013, 08:13:21 AM »
Hi,

I'm not familiar with PaPy to be honest, but I imagine what's happening is that it's trying to launch a child python process to run the job server and is using sys.executable to determine what command to use to run python.

Because pyxll is running in excel and not as its own python process, sys.executable will be excel.exe and not python.exe. PyXLL doesn't use python.exe at all, and so doesn't know where it is (it only uses the python dll).

Try setting sys.executable to the python.exe you want the child process to run as (full path, eg c:/python33/python.exe) before calling PaPy.

Best regards,
Tony

arpit.mathur

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Error running pyxll with Parallel Python
« Reply #2 on: September 16, 2013, 01:17:02 AM »
Thanks Tony! Does sound like a possible reason. Let me try your suggestions and will let you know how it goes.

Thanks