开发者

import cx_oracle fails when python script is started as win32 service

I have written a python script that should run as a windows service by subclassing the win32serviceutil.ServiceFramework. Within the script the cx_oracle module is used.

When I run the service in debug mod开发者_StackOverflowe ( python DLOGprod.py debug ) everything works fine. But when I try to start the service ( python DLOGprod.py start ) importing the cx_oracle module fails with the error:

import cx_Oracle ImportError: DLL load failed: The specified module could not be found.

I did have a look at the cx_oracle.pyd file with dependency walker and it reports about two missing dll files MSVCR90.DLL and IESHIMS.DLL.

I am having the following setup:

  • python 2.6.6
  • pywin32-214
  • cx_oracle_5.0.4-11g

Any help will be highly appreciated

mark


I did resolve my problem. The root cause was I had only added the path to the oracle client software to the user's PATH variable. Since adding it to the system wide PATH variable everything is working fine.

To troubleshoot the issue I have followed the following procedure:

  • downloaded the process explorer utility http://www.microsoft.com/technet/sysinternals/utilities/filemon.mspx
  • determined the PID of my service sc queryex [serivce name]
  • filtered after PID within process explorered
  • saw that pythonservice.exe could not find OCI.dll
  • searched for OCI.dll on my system

At this point everything was clear.

mark

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜