Author Topic: How to use with Cygwin Python Install  (Read 3627 times)

dilzio

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
How to use with Cygwin Python Install
« on: February 07, 2011, 11:35:28 AM »
Hi...

I'd like to use pyxll with the py 2.6 installed under cygwin but the addin doesn't seem to recognize that python is installed (get binary garble in a worksheet when opening excel).

How can I configure pyxll to use the correct python exec?  Previously I had this working with a standalone win32 python install but wanted to converge on cygwin for this stuff..thanks!

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 599
  • Karma: +14/-1
    • View Profile
Re: How to use with Cygwin Python Install
« Reply #1 on: February 07, 2011, 12:07:03 PM »
Hi,

It sounds like Excel isn't recognizing the addin correctly. The usual reason for that is that a dll dependency is missing. I expect that in this case it's the cygwin dll it can't find.

Can you check that both the python dll and the cygwin dll are in your system path? You could also try copying them to the same place you have the excel binary installed to see if that picks them up.

Depending on your build of python and the version of excel you're using you may also have a dependency on a version of the Microsoft c runtime that's different to the one excel uses. That's not normally a problem, but you need to ensure that can be found as well.

Dependency walker is a good tool for checking these sorts of problems. You may have it as part of a visual studio install, or you can download it for free from the web.

I hope this helps. Please let me know if you are unable to resolve this.

Regards,
Tony

dilzio

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: How to use with Cygwin Python Install
« Reply #2 on: February 07, 2011, 12:42:29 PM »
Hi...

Dependency walker for excel.exe reveals three unresolved dll's: MSJAVA.DLL, MSO.DLL, MSPTLS.DLL....none seem to be a smoking gun.  I don't see any python or cygwin dll's listed as dependencies.

Also, I've tried adding both C:\cygwin\bin and C:\cywin\lib to my windows PATH variable.

Not sure what to try next...

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 599
  • Karma: +14/-1
    • View Profile
Re: How to use with Cygwin Python Install
« Reply #3 on: February 07, 2011, 12:58:00 PM »
Hi,

Try dependency walker on pyxll.xll, making sure that it picks up the cygwin python dll.

Regards,
Tony

dilzio

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: How to use with Cygwin Python Install
« Reply #4 on: February 08, 2011, 02:10:51 AM »
Hi Tony,

It seems that there isn't really a practical way to get this to work w/o having a standalone win32 python installed.  Here's what I tried:

Running depends.exe on pyxll.xll revealed that it couldn't find PYTHON26.dll, I tried copying the cygwin version (libpython2.6.dll) in place and renaming to PYTHON26.dll but that didn't solve the issue.  I then installed the win32 python 2.6, at which point the addin began to work fine.  I then found PYTHON26.dll and copied it into my C:\cywgin\lib directory and uninstalled the python 2.6 win32 install.  When excel starts, I get an error dialog with the message: "Failed to import pyxll [No module named threading]" so it seems like it found PYTHON26.dll but that it's missing some downstream dependencies.

I think there's diminishing returns in pursuing this any further..I think my next approach is just to resign myself to using the windows install and aliasing it from cygwin.
« Last Edit: February 08, 2011, 02:18:42 AM by dilzio »