RE: Odd Error in sapdb__init__.py fast ascii

"Post, Mark K" <[email protected]> Thu, 30 Jan 2003 11:00:31 -0500
Newsgroups gmane.comp.db.sapdb.sources
Message-ID <564DE4477544D411AD2C00508BDF0B6A12F0BBC6@usahm018.exmi01.exch.eds.com>
Daniel,

Both files are there (at least they are now):
# ls SAPDB_DEV/usr/misc/sapdb/
dbapi.py  dbm.pyc      __init__.pyc  loader.pyc  sql.py
dbm.py    __init__.py  loader.py     pythondef   sql.pyc

# ls SAPDB_DEV/usr/misc/sapdb/pythondef/
dbmmodule.a    dbmmodule.so.f  loadermodule.a    loadermodule.so.f
sqlmodule.so
dbmmodule.a.f  __init__.py     loadermodule.a.f  sqlmodule.a
sqlmodule.so.f
dbmmodule.so   __init__.pyc    loadermodule.so   sqlmodule.a.f


There were some problems with initDev_SAPDB setting the correct environment
variables (at least it seemed so).  I wound up modifying them somewhat, and
that may be the cause of my problems.  Some partial output from "set":
PYTHON=/usr/bin
PYTHONPATH=/home/mark/DevTool/lib/Python:/home/mark/V74_03_07/SAPDB_DEV/usr/
misc
PYTHON_INCLUDE=/usr/include/python1.5


Mark Post

-----Original Message-----
From: [email protected]
[mailto:[email protected]]
Sent: Thursday, January 30, 2003 5:45 AM
To: [email protected]
Subject: [SAP DB Dev] Re: Odd Error in sapdb__init__.py fast ascii

Post, Mark K wrote:
> When I do a complete build (imf all), after deleting everything in
> SAPDB_DEV, I get these two errors.  But only the first time.  If I then
turn
> around and immediately do another "imf all" without deleting the results
of
> the first build, I don't see the errors.  Daniel, do you have any ideas?
> 
>    sqlpyd.dld fast
>    sql.py fast ascii
>    sapdb__init__.py fast ascii
>    !if [ -r $INSTMISC/sqlmodule.so ] ; then rm $INSTMISC/sqlmodule.so ; fi
>    !PYTHONPATH=$INSTMISC python -c "import sapdb.sql"
>    Traceback (innermost last):
>    File "", line 1, in ?
>    File "/home/mark/V74_03_07/SAPDB_DEV/usr/misc/sapdb/sql.py", line 44,\
>    in ?
>    from python15.sql import *
>    ImportError: No module named python15.sql
>    COMMAND error 1
>    'sqlpy.mac' not made because of dependency errors

I'll just describe how this is supposed to work:
for the python module 'sql', two files are needed:
usr/misc/sapdb/sql.py
usr/misc/sapdb/pythondef/sqlmodule.so

When 'import sapdb.sql' is called from python
1. sql.py gets imported
2. it tries to import pythondef/sqlmodule.so
3. if this failes, it tries other directories depending on the python 
version
(the idea being that there is just one directory to put into the 
PYTHONPATH, not several depending on the Python version)

So if pythondef/sqlmodule.so doesn't get created the first time round, 
sql.py will look for (in your case) python15/sqlmodule.so. As this isn't 
there either, the import fails.

First check if pythondef/sqlmodule.so is there. If it isn't, something 
went wrong with the make. Are there other files like sqlmodule.so.f? 
vmake creates all files with the extension .f (or .q if you do a imq) 
and then links them to the proper name.

The error might not appear on the second imf because vmake might think 
that there is nothing to do.

Daniel Dittmar

-- 
Daniel Dittmar
SAP DB, SAP Labs Berlin
[email protected]
http://www.sapdb.org