- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have solved the problem by rebuilding pyodbc.pyd library.
Required items:
- Visual Studio 2005
includes the compiler using msvcr80.dll.
- Python 2.7.3 source code
includes Python command.
- pyodbc source code
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.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have solved the problem by rebuilding pyodbc.pyd library.
Required items:
- Visual Studio 2005
includes the compiler using msvcr80.dll.
- Python 2.7.3 source code
includes Python command.
- pyodbc source code
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.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, Drainy. I am really new to Python.
I have found the way to solve the problem.
