According to the Release Note, version of Python in Splunk 5 is 2.7.3.
Reference: http://docs.splunk.com/Documentation/Splunk/5.0.2/ReleaseNotes/Python
But in Python 2.7.3 downloaded from python.org, msvcr90.dll has been included, not msvcr80.dll.
I have tried to use third-part library "pyodbc for Python 2.7" to access MS SQL Server, the library works in Python 2.7.3. In Splunk 5, it does not work since it depends on msvcr90.dll.
I still have no idea to use pyodbc in Splunk 5. Can someone help me?
I have solved the problem by rebuilding pyodbc.pyd library.
Required items:
includes the compiler using msvcr80.dll.
includes Python command.
includes build option in setup.py.
Building pyd file:
Running python.exe in Python 2.7.3\PC\VS8.0 folder to build setup.py.
Check library dependencies:
Running Dependency Walker tool.
I have solved the problem by rebuilding pyodbc.pyd library.
Required items:
includes the compiler using msvcr80.dll.
includes Python command.
includes build option in setup.py.
Building pyd file:
Running python.exe in Python 2.7.3\PC\VS8.0 folder to build setup.py.
Check library dependencies:
Running Dependency Walker tool.
Drainy, you are correct. I should not replace any files within Splunk.
Pyodbc is the third-party library that is not available in Splunk. So I rebuilt it to let it depend on msvcr80.dll using in Splunk. And I copied it to bin directory in my App. It will not be overwritten during Splunk upgrade.
If you are replacing any files within Splunk just be wary that you will need to replace these any time you upgrade Splunk - it will overwrite them each time otherwise.
Although Splunk updates the version of Python that ships with Splunk, as I understand it is still a custom build for Splunk and as such some libraries may not be updated or supported (I had some issues a year or so ago with a missing library).
For MS SQL connectivity, depending on what you want to do, you may find this app helpful;
http://splunk-base.splunk.com/apps/50803/splunk-db-connect
Thank you, Drainy. I am really new to Python.
I have found the way to solve the problem.