Skip to Content
author's profile photo Former Member
Former Member

Error Loading Python Extension Module for ASE 15,7

Hi,

It's my first post on this site. I hope I'm posting this question in the right forum.

I'm getting the following error when trying to import sybpydb using python 2.7.3. I've included version information

[sybase@localhost py]$ python

Python 2.7.3 (default, Aug 9 2012, 17:23:57)

[GCC 4.7.1 20120720 (Red Hat 4.7.1-5)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import sybpydb

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

sybpydb.DatabaseError: Error in initializing dbcapi.

>>>

[sybase@localhost py]$ echo $PYTHONPATH

/opt/sybase/ASE_15.7/OCS-15_0/python/python26_64r/lib

[sybase@localhost py]$ echo $LD_LIBRARY_PATH

/opt/sybase/ASE_15.7/ASE-15_0/lib:/opt/sybase/ASE_15.7/DataAccess64/ODBC/lib:/opt/sybase/ASE_15.7/DataAccess/ODBC/lib:/opt/sybase/ASE_15.7/OCS-15_0/lib:/opt/sybase/ASE_15.7/OCS-15_0/lib3p64:/opt/sybase/ASE_15.7/OCS-15_0/lib3p:

[sybase@localhost py]$ uname -a

Linux localhost.localdomain 3.8.11-200.fc18.x86_64 #1 SMP Wed May 1 19:44:27 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

[sybase@localhost py]$ isql -U sa -S ASE01 -w 5000

Password:

1> select @@version

2> go

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Adaptive Server Enterprise/15.7.0/EBF 20373 SMP ESD#02 /P/x86_64/Enterprise Linux/ase157esd2/3109/64-bit/FBO/Sat Jul 7 05:36:19 2012

(1 row affected)

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on May 20, 2013 at 02:12 PM

    Hi,

    You maybe running into a known bug.

    There were issues with python in the inital 15.7 releases.

    CR# 715059 -

    Title - Missing locale file causing error on intialization

    Error - sybpydb.DatabaseError: Error in initializing dbcapi.

    Fixed- 15.7 ESD#5

    You can check your client version by running the command:

    isql -v

    I would suggest using the newer Software Developers Kit(SDK)

    Steps:

    Install SDK 15.7 ESD#7 (lastest release as of 5/20/2013)

    Install Python 2.6.x (will not work with 2.4 or lower, not sure about higher version)
    Once these are installed...
    Go to your SDK install

    source SYBASE.csh

    set the environment variable PATH to run the correct python compiler.
    example:
    setenv PATH /usr/u/hansenr/activepython/bin:$PATH


    ------------------------------------------------------------------------------

    Windows:
    setenv PYTHONPATH $SYBASE/OCS-15_0/python/python26_64/dll

    edit sql.ini
    add entry for the ASE you wish to connect to.
    ASE must be version 15.7 or higher.

    example:
    [solex]
    master=TCP,solex,2212
    query=TCP,solex,2212


    unix:
    setenv PYTHONPATH $SYBASE/OCS-15_0/python/python26_64r/lib

    vi $SYBASE/interfaces
    add entry for the ASE you wish to connect to.
    ASE must be version 15.7 or higher.

    example:
    solex
    master tcp ether solex 2212
    query tcp ether solex 2212


    -------------------------------------------------------------------------------


    cd $SYBASE/OCS-15_0/sample/python

    Run the command python to make sure you have the correct version
    python
    ctrl-D out of this after you see the version (ie 2.6.x)

    Edit firstapp.py if you need to login using another login besides sa and blank password.
    You can also edit the command to print another table and so on.

    If everything looks fine run the sample:
    python firstapp.py

    Note:

    If you are using any security settings, you must enable them in the SDK.

    Example:ldap, kerberos,ssl

    -Ryan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.