|
From: Jeffrey Z. <Jef...@q-...> - 2009-03-25 13:09:51
|
Having failed at installing python-sybase on Windows, I decided to give
it a go on Linux (Ubuntu 8.10).
I think I have *almost* succeeded, but it does not "quite" work. I hope
someone can give me a pointer to get me going.
What I have done is:
1. Installed Sybase ASE 15.02 Express Edition (ase1502_xe_linux.tgz)
2. Installed the header files for Python 2.5
3. Installed python-sybase (with "python setup.py install" as root)
The install seemed to go OK, but when I try to import the Sybase module
in a Python interpreter, I see the following exception:
jeffreyz@jeffreyz-Ubuntu-8:~$ python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import Sybase
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.linux-i686/egg/Sybase.py", line 11, in <module>
File "build/bdist.linux-i686/egg/sybasect.py", line 7, in <module>
File "build/bdist.linux-i686/egg/sybasect.py", line 6, in
__bootstrap__
ImportError: libsybtcl.so: cannot open shared object file: No such
file or directory
>>>
As you can see, it is complaining that it cannot find the shared library
"libsybtcl.so". I have looked on my machine and there is a copy of
libsybtcl.so in both of these directories:
/opt/sybase/OCS-15_0/lib/
/opt/sybase/OCS-15_0/devlib/
I do not understand what is wrong.
1. Was there, in fact, a problem with the build of python-sybase?
If so, please indicate how I can fix this problem.
2. Was the build OK, but I need to configure something else after the
build
(so that it finds libsybtcl.so)? If so, please indicate what I can
do.
Many thanks in advance. I think I am getting close, but I will be stuck
without a little help.
Jeffrey Zelt
QFree ASA
|
|
From: <sk...@po...> - 2009-03-25 14:44:38
|
Jeffrey> What I have done is:
Jeffrey> 1. Installed Sybase ASE 15.02 Express Edition
Jeffrey> (ase1502_xe_linux.tgz)
Jeffrey> 2. Installed the header files for Python 2.5
Jeffrey> 3. Installed python-sybase (with "python setup.py install" as
Jeffrey> root)
Replace #3 with
python setup.py build_ext -R /opt/sybase/OCS-15_0 -L /opt/sybase/OCS-15_0
python setup.py install
or run the interpreter with /opt/sybase/OCS-15_0 in LD_LIBRARY_PATH.
--
Skip Montanaro - sk...@po... - http://www.smontanaro.net/
|
|
From: John M. C. <jm...@xm...> - 2009-03-25 15:45:05
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000099">
<br>
<br>
Jeffrey Zelt wrote:<br>
<snip><br>
<blockquote
cite="mid:F8E...@MX..."
type="cite">
<pre wrap="">
The install seemed to go OK, but when I try to import the Sybase module
in a Python interpreter, I see the following exception:
</pre>
</blockquote>
<snip><br>
<blockquote
cite="mid:F8E...@MX..."
type="cite">
<pre wrap="">As you can see, it is complaining that it cannot find the shared library
"libsybtcl.so". I have looked on my machine and there is a copy of
libsybtcl.so in both of these directories:
/opt/sybase/OCS-15_0/lib/
/opt/sybase/OCS-15_0/devlib/
</pre>
</blockquote>
I'd guess, off hand, that neither of those directories is in the
dynamic library path unless you're logged in as sybase (and have
ensured that your .bashrc [or appropriate file] includes a call to
source /opt/sybase/SYBASE.sh [or the equivalent if you use the Korn
shell]).<br>
<br>
Now, you might also simply add those directories to the system dynamic
library path:<br>
(I think this is pretty universal across different Linux versions, but
you can check via man ldconfig.) Create a file called (for instance)
/etc/ld.so.conf.d/sybase.conf with these two lines:<br>
<pre wrap="">/opt/sybase/OCS-15_0/lib/
/opt/sybase/OCS-15_0/devlib/
</pre>
Then run ldconfig. You should be in business. <br>
<br>
Alternatively, you could add soft links to libsybtcl.so in the lib
directories used by Python (or just in /usr/lib ).<br>
<br>
HTH!<br>
<br>
JMC<br>
</body>
</html>
|
|
From: Jeffrey Z. <Jef...@q-...> - 2009-03-30 06:37:40
|
Bingo! That was the tip I needed. I have now successfully connected to
one of our Sybase servers with python-sybase.
By the way, it was only necessary for me to place the line:
/opt/sybase/OCS-15_0/lib/
in a file that ldconfig could process. It was _not_ necessary to
include the second line:
/opt/sybase/OCS-15_0/devlib/
Thank you for your help, as well as to others who also tried to assist
me!
Regards,
Jeffrey Zelt
Q-Free ASA
The install seemed to go OK, but when I try to import the Sybase module
in a Python interpreter, I see the following exception:
<snip>
As you can see, it is complaining that it cannot find the shared library
"libsybtcl.so". I have looked on my machine and there is a copy of
libsybtcl.so in both of these directories:
/opt/sybase/OCS-15_0/lib/
/opt/sybase/OCS-15_0/devlib/
I'd guess, off hand, that neither of those directories is in the dynamic
library path unless you're logged in as sybase (and have ensured that
your .bashrc [or appropriate file] includes a call to source
/opt/sybase/SYBASE.sh [or the equivalent if you use the Korn shell]).
Now, you might also simply add those directories to the system dynamic
library path:
(I think this is pretty universal across different Linux versions, but
you can check via man ldconfig.) Create a file called (for instance)
/etc/ld.so.conf.d/sybase.conf with these two lines:
/opt/sybase/OCS-15_0/lib/
/opt/sybase/OCS-15_0/devlib/
Then run ldconfig. You should be in business.
|
|
From: Lloyd K. <py...@ve...> - 2009-03-25 17:21:41
|
On Wed, 2009-03-25 at 14:09 +0100, Jeffrey Zelt wrote:
> Having failed at installing python-sybase on Windows, I decided to
> give it a go on Linux (Ubuntu 8.10).
>
Just use the package manager!
>From the Menus:
System/Administration/Synaptic
If you put sybase in the search box, you'll quickly find python-pymssql.
Make sure that Synaptic is searching the community supported
repositories:
Settings/Repositories/[Ubuntu Software TAB]/Community...checkbox
Linux system administration is dead simple if you just use the package
management tools.
<True Confessions>I'm actually running python-sybase on an older server
where I did have to compile it myself.</True>
--
Lloyd Kvam
Venix Corp
DLSLUG/GNHLUG library
http://dlslug.org/library.html
http://www.librarything.com/catalog/dlslug
http://www.librarything.com/rsshtml/recent/dlslug
http://www.librarything.com/rss/recent/dlslug
|
|
From: Abel Q. <bel...@ho...> - 2009-03-28 11:24:48
|
>I have also tried using the latest version of Python 2.6.x, but the >installation fails with > >running build_ext >building 'sybasect' extension >error: None To install it on Python 2.6, you need to get the VC++ 2008 Express Edition. After you install it, run the python sybase install script from within the Visual Studio 2008 Command Prompt shell. A shortcut to it is supposed to be available inside the VC++2008 folder under Start > Programs If this does not work as expected (which happened to me on one workstation), I manually ran the target of the Visual Studio 2008 Command Prompt shortcut on a command prompt and then ran the python sybase install script. Please, let me know how it goes. |