Can't install ibm_db in Win 7 x64 enviroment

629 views
Skip to first unread message

pjagi...@gmail.com

unread,
Feb 7, 2013, 9:22:04 AM2/7/13
to ibm...@googlegroups.com
Help!  I can't get ibm_db installed on my Win 7 x64 box.  I'm using Python 2.7.3 x64 and I have the IBM 9.7 x64 client software installed.  I can access our DB2 database with Toad DB management software, so I know the basic connectivity is working.  When I try to install ibm_db with "easy_install ibm_db", I get the following error:

C:\>easy_install ibm_db

Searching for ibm-db
Best match: ibm-db 2.0.1
md5=cb450200a703f7019840a27f725ffa3d
Processing ibm_db-2.0.1.tar.gz
Writing c:\users\jagiep\appdata\local\temp\easy_install-erl1wf\ibm_db-2.0.1\setu
p.cfg
Running ibm_db-2.0.1\setup.py -q bdist_egg --dist-dir c:\users\jagiep\appdata\lo
cal\temp\easy_install-erl1wf\ibm_db-2.0.1\egg-dist-tmp-s5xgrq
Detected 64-bit Python
c:\users\jagiep\appdata\local\temp\easy_install-erl1wf\ibm_db-2.0.1\setup.py:52:
 UserWarning: Detected usage of IBM Data Server Driver package. Ensure you have
downloaded 64-bit package of IBM_Data_Server_Driver and retry the ibm_db module
install

  warnings.warn(notifyString)
error: Setup script exited with error: Unable to find vcvarsall.bat

Regarding vcvarsall.bat, I've tried running that before the easy_install step, but still no joy.

Anyone know what I may be doing wrong?

P.S. I get the same error when I try to install with pip.

pjagi...@gmail.com

unread,
Feb 7, 2013, 1:52:15 PM2/7/13
to ibm...@googlegroups.com
Here's an update.  I got ibm_db to install via "easy_install ibm_db-2.0.1-py2.7-win32.egg".  However, when I go to the Python console and type "import ibm_db", I get the following error:

Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ibm_db
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: DLL load failed: %1 is not a valid Win32 application.
>>>

Any ideas?  I've got the following environment vars defined:

IBM_DB_DIR = C:\Program Files\IBM\SQLLIB
IBM_DB_HOME = C:\Program Files\IBM\SQLLIB
IBM_DB_LIB = C:\Program Files\IBM\SQLLIB\LIB

Also, my path contains the path to C:\Program Files\IBM\SQLLIB\LIB.

Rahul

unread,
Feb 7, 2013, 2:17:52 PM2/7/13
to ibm_db
"ibm_db-2.0.1-py2.7-win32.egg" build with 32bit Python, so you can't
use this for 64-bit python. You can install a 32-bit python on your 64-
bit window machine and install ibm_db driver. You also need to install
32-bit of IBM_Data_Server_Driver package.

Thanks,
Rahul

Rahul

unread,
Feb 7, 2013, 2:22:55 PM2/7/13
to ibm_db
The error you are reported in your first post is about missing Visual
studio libraries. For 64-bit python we are shipping any binary and not
even tested, so easy_install was trying to buildi bm_db on you system
but due to missing Visual studio libraries it throws error.

On Feb 7, 11:52 pm, pjagiel...@gmail.com wrote:

pjagi...@gmail.com

unread,
Feb 8, 2013, 1:24:06 PM2/8/13
to ibm...@googlegroups.com
Rahul,

Thank you for responding.  Due to time constraints, I've gone back to Python x32, and ibm_db is working just fine.

Michał Skrzędziejewski

unread,
Feb 13, 2013, 8:57:42 AM2/13/13
to ibm...@googlegroups.com
I'm trying to install ibm_db on 64-bit Python 2.7. I have Visual Studio Express 2010.I had to set VS90COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\ because the installer expects Visual Studio 2008.

However, compilation fails due to:

Running ibm_db-2.0.1\setup.py -q bdist_egg --dist-dir c:\users\mskrze~1\appdata\local\temp\easy_install-deomjq\ibm_db-2.0.1\egg-dist-tmp-oej3cg
ibm_db.c
c:\users\mskrzedzieje\appdata\local\temp\easy_install-deomjq\ibm_db-2.0.1\ibm_db.h(31) : warning C4005: 'PyObject_CheckBuffer' : macro redefinition
        c:\python27\include\abstract.h(537) : see previous definition of 'PyObject_CheckBuffer'
ibm_db.c(5306) : warning C4018: '<=' : signed/unsigned mismatch
ibm_db.c(5310) : warning C4018: '<=' : signed/unsigned mismatch
ibm_db.c(5424) : warning C4018: '<=' : signed/unsigned mismatch
ibm_db.c(9533) : warning C4244: 'function' : conversion from 'SQLINTEGER' to 'SQLSMALLINT', possible loss of data
python27.lib(python27.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
Detected 64-bit Python

Why does it try to compile x86 version?
I only have 64-bit Python 2.7 on my machine

Rahul

unread,
Feb 14, 2013, 1:31:56 AM2/14/13
to ibm_db
Your compilation environment is for x86(32-bit) but you are trying to
compile and link with x64(64-bit) python.

Thanks,
Rahul

On Feb 13, 6:57 pm, Michał Skrzędziejewski <doc...@gmail.com> wrote:
> I'm trying to install ibm_db on 64-bit Python 2.7. I have Visual Studio
> Express 2010.I had to set VS90COMNTOOLS=C:\Program Files (x86)\Microsoft
> Visual Studio 10.0\Common7\Tools\ because the installer expects Visual
> Studio 2008.
>
> However, compilation fails due to:
>
> Searching for ibm-db
> Readinghttp://pypi.python.org/simple/ibm_db/
> Readinghttp://code.google.com/p/ibm-db/downloads/list
> Best match: ibm-db 2.0.1
> Downloadinghttp://pypi.python.org/packages/source/i/ibm_db/ibm_db-2.0.1.tar.gz#m...
Reply all
Reply to author
Forward
0 new messages