Menu

#9 Install Problem

open
nobody
5
2008-08-20
2008-08-20
Anonymous
No

First there are no install instructions for users who are new to installing python modules, not even basic instructions.
So without any guidance I decided to try to install this on Ubuntu 7.10 (Linux).
I opened up my Python shell IDLE and attempted to run the setup.py module. It failed horribly of course. So I edited it to the correct location of my DB2:
DB2_ROOT = "/opt/ibm/db2/V9.1/"
Still failed. So I decided that I would comment out the section that was executing so that it would take my location:
# Begin Comment out by RJM
#for root in ['/opt/IBM/db2', '/opt/ibm/db2', '/usr/IBMdb2']:
# if os.path.exists(root):
# files = os.listdir(root)
# for path in files:
# if path[:1] == "V" and path.find(".") > 0:
# print "Found DB2 with standard location search"
# return os.path.join(root, path)
# End Comment out by RJM

This worked, now the setup file was able to find my DB2.
Then I decided to run the DB2.py module in IDLE. It too failed of course:
ImportError: No module named _db2
Of course there isn't a module named _db2, I can see that from the package I downloaded. So where is it? Being a newbie I can't find it. Then it dawned on me that perhaps one or both of the _db2_module.c or the _db2_module.1_10.c need to be compiled into the _db2.py module. But this is just a guess. Maybe you could clarify this? I also noticed that someone else had tried running:
$ perl setup.py install
So I gave that a shot, hoping that maybe that would compile the missing _db2 module, but I got nothing but more errors:
Semicolon seems to be missing at setup.py line 14.
Bareword found where operator expected at setup.py line 21, near "'DB2DIR' in"
(Missing operator before in?)
Bareword found where operator expected at setup.py line 29, near "f"
(Missing semicolon on previous line?)
String found where operator expected at setup.py line 32, near "s = [i.strip() for i in s.split('\n') if i.strip() != ''"
(Do you need to predeclare s?)
Bareword found where operator expected at setup.py line 43, near "# files = os"
(Might be a runaway multi-line == string starting on line 33)
(Missing operator before os?)
Semicolon seems to be missing at setup.py line 55.
Bareword found where operator expected at setup.py line 65, near ")
# Give up noisily
raise"
(Missing operator before raise?)
Semicolon seems to be missing at setup.py line 66.
Semicolon seems to be missing at setup.py line 72.
String found where operator expected at setup.py line 85, near "Compilation may fail.""
(Might be a runaway multi-line "" string starting on line 83)
(Missing semicolon on previous line?)
String found where operator expected at setup.py line 85, near "Compilation may fail.""""
(Do you need to predeclare Compilation?)
Semicolon seems to be missing at setup.py line 86.
syntax error at setup.py line 15, near "def find_db2rootdir"
Unmatched right square bracket at setup.py line 32, at end of line
Execution of setup.py aborted due to compilation errors.

So here is where I had to quit. How about a little documentation that provides some basic install instructions for those of us who have never installed a python module before. Am I missing the _db2 module or does it get created if setup.py is somehow run successfully?

Discussion

  • Nobody/Anonymous

    Logged In: NO

    I figured out from another website that you are supposed to run as follows: $ python setup.py install
    But this did not help cause I got the following:
    Found DB2 with db2level
    DB2 install path: "/opt/ibm/db2exc/V9.5"
    DB2 include path: "/opt/ibm/db2exc/V9.5/include"
    DB2 lib path: "/opt/ibm/db2exc/V9.5/lib32"
    DB2 library: "db2"
    running install
    running build
    running build_py
    running build_ext
    building '_db2' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O2 -Wall -Wstrict-prototypes -fPIC -I/opt/ibm/db2exc/V9.5/include -I/usr/include/python2.5 -c _db2_module.c -o build/temp.linux-i686-2.5/_db2_module.o
    _db2_module.c:15:20: error: Python.h: No such file or directory
    _db2_module.c:24:26: error: structmember.h: No such file or directory
    ... and the errors continue for pages.

     
  • Nobody/Anonymous

    The following errors on Ubuntu are easily solved:
    _db2_module.c:15:20: error: Python.h: No such file or directory
    _db2_module.c:24:26: error: structmember.h: No such file or directory

    run: sudo apt-get install python-dev

    This will install the python devel headers.

    Also you need to execute: sudo python setup.py install
    or you get this error:
    copying build/lib.linux-i686-2.5/_db2.so -> /usr/lib/python2.5/site-packages
    error: /usr/lib/python2.5/site-packages/_db2.so: Permission denied

     
  • Nobody/Anonymous

    The following errors on Ubuntu are easily solved:
    _db2_module.c:15:20: error: Python.h: No such file or directory
    _db2_module.c:24:26: error: structmember.h: No such file or directory

    run: sudo apt-get install python-dev

    This will install the python devel headers.

    Also you need to execute: sudo python setup.py install
    or you get this error:
    copying build/lib.linux-i686-2.5/_db2.so -> /usr/lib/python2.5/site-packages
    error: /usr/lib/python2.5/site-packages/_db2.so: Permission denied

     
  • Nobody/Anonymous

    The following errors on Ubuntu are easily solved:
    _db2_module.c:15:20: error: Python.h: No such file or directory
    _db2_module.c:24:26: error: structmember.h: No such file or directory

    run: sudo apt-get install python-dev

    This will install the python devel headers.

    Also you need to execute: sudo python setup.py install
    or you get this error:
    copying build/lib.linux-i686-2.5/_db2.so -> /usr/lib/python2.5/site-packages
    error: /usr/lib/python2.5/site-packages/_db2.so: Permission denied

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.