Closed GoogleCodeExporter closed 9 years ago
Thanks for the report. I noticed in the source package that I forgot to add
the pre-built libary and header for 32 bit systems. I have pushed the changes
to HG and uploaded a new source package:
http://code.google.com/p/pymssql/downloads/detail?name=pymssql-2.0.0b1-dev-20111
019.tar.gz&can=2&q=#makechanges
A few other thoughts:
* I'd recommend that you use the latest Cython version. If you are concerned
about conflicts with other projects, use a virtualenv.
* The fact that you have FreeTDS 0.82 installed may be a problem when building
from source. The library from your installed version of FreeTDS may be used
instead of the one packaged with pymssql. If that is the case, then you will
continue to receive "DBVERSION_71 undeclared" references because 0.82 didn't
have those symbols defined.
Original comment by rsyr...@gmail.com
on 19 Oct 2011 at 5:26
[root@ris pymssql-2.0.0b1-dev-20111019]# PATH=/opt/python2.7/bin:$PATH python
Python 2.6.7 (r267:88850, Oct 21 2011, 13:39:51)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymssql
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_mssql.pxd", line 10, in init pymssql (pymssql.c:8589)
cdef class MSSQLConnection:
ImportError:
/opt/python2.7/lib/python2.6/site-packages/pymssql-2.0.0b1_dev_20111019-py2.6-li
nux-i686.egg/_mssql.so: undefined symbol: __asprintf_chk
python setup.py build and install ok, but when I try to import pymssql I
receive those errors :(
Original comment by VL.Var...@gmail.com
on 21 Oct 2011 at 11:15
you say your are building it, but you are actually installing the egg, is that
correct? You are on an older version of Red Hat, so my guess is that its a GCC
incompatibility. Have you tried building from source?
Original comment by randy.sy...@lev12.com
on 21 Oct 2011 at 4:15
1. Centos 5.7 have very old python - 2.4, so I download latest 2.6 release
2. Compile him from sources, add easy_install, add cython
3. If I try to compile pymssql-2.0.0b1-dev-20111019 from tarball from this
site, I have error messages written above (ImportError:
/opt/python2.7/lib/python2.6/site-packages/pymssql-2.0.0b1_dev_20111019-py2.6-li
nux-i686.egg/_mssql.so: undefined symbol: __asprintf_chk) after import pymssql.
4. If I compile freetds latest version from source and symlinked their include
and lib to freetds/unix_32/lib and include - I compile pymssql okay, import
pymssql okay, but have trouble with execute stored procedure:
Traceback (most recent call last):
File "testpymssql.py", line 3, in <module>
conn = pymssql.connect(server='dbsocial', user='user', password='************',as_dict=True)
File "pymssql.pyx", line 552, in pymssql.connect (pymssql.c:7162)
raise InterfaceError(e[0])
pymssql.InterfaceError: Connection to the database failed for an unknown reason.
[root@ris adm]# joe testpymssql.py
Processing '/etc/joe/joerc'...Processing '/etc/joe/ftyperc'...done
done
import pymssql
conn=pymssql.connect(host='dbsocial',user='user',password='****',database='gamed
ata',as_dict=True)
cur = conn.cursor()
cur.callproc('gamedata.dbo.usp_GetBSStats')
Original comment by VL.Var...@gmail.com
on 24 Oct 2011 at 11:23
tsql connects and return data okay with this creditionals
Original comment by VL.Var...@gmail.com
on 24 Oct 2011 at 11:38
Unfortunately, I'm going to need someone to help with issues related to the
static library builds. I'm really not sure what is going on there, I don't do
that much C programming.
Concerning your attempt to connect after compiling from source:
A) make sure you delete the pre-compiled libraries in the source archive, just
to avoid conflics
B) please use FreeTDS config logging to make sure you are connecting with the
credentials you think you are connecting with:
www.freetds.org/userguide/logging.htm
Original comment by rsyr...@gmail.com
on 24 Oct 2011 at 2:11
subject: my issue fixed
problem was: old lib found in /usr/lib/libsybdb.so.5 (old freetds lib version
0.64)
how it may discovered: enable freetds logging by $ export
TDSDUMP=/tmp/freetds.log and very carefully examine results. In my case I
wondered that freetds says me my server not found even its have in freetds.conf
file, and first line of trace file says what freetds version used
How to fix: carefully remove old freetds version (e.g. /usr/lib/libsybdb.so.5
file),
compile last freetds (I use ./configure --with-tdsver=7.1 --enable-msdblib)
ensure resulting lib be found in ldconfig path ( I symlinked
/usr/local/lib/libsybdb.so.5 to /usr/lib/libsybdb.so.5 ( command is "ln -s
/usr/local/lib/libsybdb.so.5 /usr/lib/libsybdb.so.5" and rerun ldconfig). Check
ldconfig cache for currect lib:
ldconfig -p | grep libsybdb.so.5
libsybdb.so.5 (libc6) => /usr/lib/libsybdb.so.5
Grab last pymssql tarball, untar it
cd to freetds/nix_(your arch) in my case -
pymssql-2.0.0b1-dev-20111019/freetds/nix_32
remove include and lib dirs, create symlinks to include and lib directory to
freetds source dir. In my case result sounds like:
# ls -la
lrwxrwxrwx 1 root root 18 Oct 24 18:27 include -> /usr/local/include
lrwxrwxrwx 1 root root 14 Oct 24 18:27 lib -> /usr/local/lib
(I compile freetds without any --predix options)
Ensure you using correct python, cyphon and easy install modules
I use:
PATH=/opt/python2.7/bin:$PATH python setup.py clean
PATH=/opt/python2.7/bin:$PATH python setup.py build
PATH=/opt/python2.7/bin:$PATH python setup.py install
After that import pymssql and other code works fine. As additional you can set
TDSVER and FREETDS enviroment variable as explained at
http://www.freetds.org/userguide/envvar.htm for ensure using correct
freetds.conf file (my freetds.conf located in /usr/local/etc directory)
Original comment by VL.Var...@gmail.com
on 25 Oct 2011 at 9:44
Thanks for the follow-up report, glad you got it fixed. FYI, w/ pymssql you
should not need a freetds.conf file.
Resolving as fixed since we pushed new source to address the missing x86
pre-compiled libraries.
Original comment by rsyr...@gmail.com
on 25 Oct 2011 at 2:47
In tarball pymssql-2.0.0b1-dev-20111019.tar.gz, 64-bit build still has this
problem. Possibly files in freetds/nix_64/* were not updated:
nix_32/lib:
-rw-r--r-- 1 1000 1000 1528394 Oct 18 06:21 libsybdb.a
nix_64/lib:
-rw-r--r-- 1 1000 1000 2169356 Oct 17 06:49 libsybdb.a
What worked for me (I have freetds 0.91-1.el5 installed):
1. rm freetds/nix_64/lib/libsybdb.a
2. ln -s /usr/lib64/libsybdb.so.5.0.0 /usr/lib64/libsybdb.so
3. python26 setup.py clean
4. python26 setup.py build
5. python26 setup.py install
Original comment by m.maly...@gmail.com
on 6 Dec 2011 at 12:18
Original issue reported on code.google.com by
tonal.pr...@gmail.com
on 19 Oct 2011 at 4:41