Problems Installing Python 3.4 ibm_db on Windows Server 2012 Standard

651 views
Skip to first unread message

Connor Sanders

unread,
Jan 20, 2016, 9:53:06 PM1/20/16
to ibm_db
Hey all,

I am attempting to install and use the ibm_db package for Python 3.4 on a windows 2012 server. For some reason I simply can not get it to work. When I use easy_install I am not able to import the library, it is simply not found. When I use pip I am able to import the library, but none of the function like pconnect are referable. Only __bootstrap__ shows up. Also when I try to run it the following error is returned:

 Traceback (most recent call last):
 File "C:/Python34/Lib/site-packages/ibm_db-2.0.6-py3.4.egg/ibm_db.py", line 10, in <module>
   __bootstrap__()
 File "C:/Python34/Lib/site-packages/ibm_db-2.0.6-py3.4.egg/ibm_db.py", line 9, in __bootstrap__
   imp.load_dynamic(__name__,__file__)
ImportError: DLL load failed: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

Anyway I am new to db2 scripting using python, and I am wondering if there is something simple I am missing.


Thanks in advanced,

Connor

amarredd

unread,
Jan 21, 2016, 8:38:16 AM1/21/16
to ibm_db
Hello  Connor,

It looks like MSVC mismatch problem. We have built ibm_db.dll using Microsoft Visual Studio 2010 for python 3.4.(https://docs.python.org/3.4/using/windows.html#compiling-python-on-windows).
I tried ibm_db using python 3.4 on my windows 7 and it seems to work fine.

What error did you hit while using easy_install. Could you please share the same.

-Amar

Connor Sanders

unread,
Jan 22, 2016, 1:38:44 AM1/22/16
to ibm_db
Hi Amar,

We managed to get through a lot of those issues by switching to python 2,7. However now we are getting this error. I'll paste the code and the error for you to look at.

Thanks for your help!
_____________________________________
Code:

import ibm_db

conn = ibm_db.pconnect("dsn=database", "username", "password")

print(conn)
______________________________________
Error:

C:\Python27\python.exe C:/Users/PycharmProjects/project/script.py
Traceback (most recent call last):
  File "C:/Users/PycharmProjects/project/script.py", line 5, in <module>
    conn = ibm_db.pconnect("dsn=database", "username", "password")
 SQLCODE=-1531

Process finished with exit code 1
__________________________________

amarredd

unread,
Jan 22, 2016, 1:54:29 AM1/22/16
to ibm_db
Hello Connor,

The reason for error -1531 is your configuration is not correct in config.py
Try connection after modifying configuration information.

refer below link for error -1531,
https://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.messages.sql.doc/doc/msql01531n.html?lang=en

Thanks.
Amar
Reply all
Reply to author
Forward
0 new messages