on 05-12-2013 7:46 PM
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)
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ryan,
The latest EBF I see on http://downloads.sybase.com/swd/detail.do is
EBF 20953: 15.7 ESD #4.2 - 64 Bit. Is there anyother location I can get it from?
Thanks for your answer.
Hi,
You said you were able to get to - ASE 15.7 EBF 20953 ESD #4.2 - 64 Bit.
This includes the SDK client:
isql -v
Sybase CTISQL Utility/15.7/P-EBF20831 ESD #5 ONE-OFF/DRV.15.7.0.5/Linux Intel/Linux 2.6.18-128.el5 i686/BUILD1570-024/OPT/Mon Dec 17 05:28:30 2012
You can download this ASE version and run a custom install to download the python client.
Based on the version of client this should be fixed.
Ran a quick test with this release and was able to get firstapp.py to work with python.
>python
Python 2.7.3 (default, Mar 11 2013, 08:19:20)
[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2
PYTHONPATH=/work/hansenrsyb/OCS-15_0/python/python26_64r/lib
DSQUERY=solex
(interfaces file has the "solex" entry)
>python firstapp.py
White: Menlo Park
Green: Oakland
...
Regards,
-Ryan
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.