Pyodbc for Ubuntu Lucid?

295 views
Skip to first unread message

jd...@jdege.us

unread,
Jan 9, 2012, 11:34:19 AM1/9/12
to pyodbc, jd...@korterra.com
I have a AMD64 server running Ubuntu 10.04 (Lucid Lynx), on which I
need to run a script that inserts records into a Sql Server database.

I'd been thinking that Python and pyodbc would work. Which it might,
except that the Ubuntu package python-pyodbc only exists for Maverick
+.

So I tried installing pyodbc-3.0.2-1.x86_64.rpm, using an .rpm->.deb
converter, and it seems to have installed OK, but only in /usr/lib/
python2.7. And Lucid only includes Python 2.6.

So my choices seem to be:

1. Build Python 2.7 from source, and to an alt-install
2. Build pyodbc from source, targeting Python 2.6
3. Find a binary package that includes Python 2.6 that will install on
a 64-bit Ubuntu 10.04

Before I start messing about with nos. 1 or 2, I thought I'd ask about
no. 3.

Does anyone know of a binary install package that will work on a 64-
but Ubuntu 10.04, that includes a build of pyodbc that targets Python
2.6?

Thanks.

ma...@ilc.cc

unread,
Feb 6, 2012, 12:19:58 PM2/6/12
to pyo...@googlegroups.com, jd...@korterra.com
It is true that there is no pyodbc package in Ubuntu.  However, using python-setuptools we can do an easy_install of pyodbc.  This method will compile pyodbc from source.

First, you need to apt-get install python-setuptools.  Then, make sure you have all the dependencies.  You need unixodbc, unixodbc-dev, and build-essential.  You also may need to get python-dev.  Apt-get all of these packages and then run sudo easy_install pyodbc.  This is the method that worked for me, I hope you find this useful!


Reply all
Reply to author
Forward
0 new messages