installation error

77 views
Skip to first unread message

KRZhang

unread,
Oct 21, 2011, 2:42:37 AM10/21/11
to pyodbc
Hello,

I run ubuntu 10.04, I had freeTDS 0.82 and unixODBC 2.2.11 working
fine (installed with apt-get). I installed pyodbc and that worked as
well.

Recently, I needed a higher version of freeTDS, I uninstalled all of
those things and installed in order (from source, because the
repositories were out of date):
unixODBC 2.3
freeTDS 0.91

up through this point everything worked fine. Now I am trying to build
and install pyodbc from source:
----
Traceback (most recent call last):
File "setup.py", line 326, in <module>
main()
File "setup.py", line 61, in main
settings = get_compiler_settings(version_str)
File "setup.py", line 147, in get_compiler_settings
get_config(settings, version_str)
File "setup.py", line 196, in get_config
import pyodbcconf
ImportError: libodbc.so.1: cannot open shared object file: No such
file or directory
----

the only similar post I can find was this guy:

http://groups.google.com/group/pyodbc/browse_thread/thread/c8f69db656ce9bd1

and he seemed to have solved it himself by changing environment
variables. However, I currently have no idea what the right path is to
set. What should I do to install pyodbc correctly?

-Yan

Michael Kleehammer

unread,
Oct 25, 2011, 1:08:57 PM10/25/11
to pyo...@googlegroups.com
Part of the build process is to build a temporary Python extension pyodbcconf so I can determine the size of some Unicode types (wchar_t, SQLWCHAR, etc.).  Usually when you run setup build, it will build this in build/lib.<platform>/.  It should then add this directory to the system path and import it.

Is there a pyodbcconf.pyd file in the build/lib.<platform>/ directory?

zig007

unread,
Oct 29, 2011, 7:15:55 PM10/29/11
to pyodbc
I had to manually add it (/usr/local/lib) to pythons' LOAD_LIBRARY
environment-variable to make it work.

zig007

unread,
Oct 29, 2011, 9:41:13 PM10/29/11
to pyodbc
Actually, I had to also add the TDSVER-variable for it to properly
connect to the server.

KRZhang

unread,
Oct 30, 2011, 10:24:22 PM10/30/11
to pyodbc
Michael and zig007:

After I wrote the error report I rolled back my changes to let the
project run for a while. Today I tried to do the installation again
but it just worked with no hitch =/ I'll keep your advice in mind for
the future though. Thanks for your help.

Also just to be precise: zig007, do you mean those to be the shell
environment variables (as in setenv) or python's variables? (as in
os.environ)?

-Yan
Reply all
Reply to author
Forward
0 new messages