|
Building
Building pyodbc
OverviewObtaining SourceThe source for released versions are provided in zip files on the Downloads page. If you are going to work on pyodbc (changes are welcome!), use the git repository on github. (Even better, create a fork on github so I can easily pull changes from your fork.) If you want an unreleased version from github but don't have git installed, choose the branch and commit you want and use the download button. It will offer you a tar or zip file. Compilingpyodbc is built using distutils, which comes with Python. If you have the appropriate C++ compiler installed, run the following in the pyodbc source directory: python setup.py build To install after a successful build: python setup.py install Versionpyodbc uses git tags in the format major.minor.patch for versioning. If the commit being built has a tag, such as "2.1.1", then that is used for the version. If the commit is not tagged, then it is assumed that the commit is a beta for an upcoming release. The patch number is incremented, such as "2.1.2", and the number of commits since the previous release is appended: 2.1.2-beta3. If you are building from inside a git repository, the build script will automatically determine the correct version from the tags (using git describe). If you downloaded the source as a zip from the Downloads page, the version will be in a PGK-INFO text file. The build script will read the version from the text file. If the version cannot be determined for some reason, you will see a warning about this and the script will build version 2.1.0. Do not distribute this version since you won't be able to track its actual version! Operating SystemsWindowsOn Windows, you will need the appropriate Microsoft Visual C++ compiler. To build Python 2.4 or 2.5 versions, you will need the Visual Studio 2003 .NET compiler. Unfortunately there is no free version of this. For Python 2.6 and above, you can use the free Visual C++ 2008 Express compiler. (Do not use the 2010 version! You need to use the version that your Python distribution was built with.) You can create a Windows installer using: python setup.py bdist_wininst OtherTo build on other operating systems, use the gcc compiler. On Linux, pyodbc is typically built using the unixODBC headers, so you will need unixODBC and its headers installed. On a RedHat/CentOS/Fedora box, this means you would need to install unixODBC-devel: yum install unixODBC-devel |
If compiling for Ubuntu (and possibly other flavors of Linux) you'll need the unixODBC-dev package.
sudo apt-get install unixODBC-dev
Hi,
Sorry I did not find any way to contact you hence adding a comment here. I have an application which was developed in Python 2.3 and now they want to add MS SQL Server support to it. I was searching for the connection on windows when I came across this project. But I am not finding any installer for Python 2.3. Can you please let me know how can I connect to MS SQL Server using Python 2.3
You can contact me at natraj.kadur@gmail.com
You might want to try the Google group here: http://groups.google.com/group/pyodbc
To avoid gcc error on Ubuntu Linux, I did:
I also installed the following 2 packages from Synaptic:
To avoid 'no default driver specified' error when connecting to MSSQL db, I had to create /etc/odbcinst.ini and put the following entry:
Source: http://www.mail-archive.com/sqlalchemy@googlegroups.com/msg08435.html
Visual C++ 2008 Express download: http://www.microsoft.com/express/downloads/#2008-Visual-CPP
What do I do wrong? I get stuck with error after
Traceback (most recent call last): File "setup.py", line 270, in <module> main() File "setup.py", line 61, in main version_str, version = get_version() File "setup.py", line 212, in get_version name, numbers = _get_version_git() File "setup.py", line 255, in _get_version_git branch = re.search(r'\* (\w+)', result).group(1) AttributeError: 'NoneType' object has no attribute 'group'<wiki:comment> After the 3.0.2 version of pyodbc was built and installed on centos6.1, the pyodbc can still not work. After "import pyodbc", "conn" and "conn.commit()", a simple sentence such as "select * from dbcinfo" can not work on "cur.execute('select * from dbcinfo')". However, in the "client" samples written with C++, "./adhoc" can illustrate that odbc on teradata really work on "cur.execute('select * from dbcinfo')". Thus, there should be something wrong with 3.0.2, which is used to wrap C or C++ for python. </wiki:comment>
I got the bug through the following process: (1) install unixodbc-dev (2) install teradata's odbc for 64 (3) install the corresponding package with the help of strace (4) check the validation of client on centos (5) make the samples supplied by C++ (6) run the command "./adhoc" in the folder "/opt/teradata/client/13.10/odbc_64/samples/C++" (7) the command remind a SQL sentence (8) input the SQL liking in "Teradata SQL Assistant" (9) get the normal result (10) walk into python environment with python command on centos (11) test connect teradata with typical python commands (12) on the step "cur.execute('select from dbcinfo')", a strange error is: Traceback (most recent call last): pyodbc.Error: ('400', '400? [eaaarvr[eaaaDtbs?Sna ro:epce oehn ewe h einn fterqetadtewr s. (-3706) (SQLExecDirectW)')
how can i compile the pyodbc3.0.6 for python 3.3 on a win7 system?there is a error message is "Unable to find vcvarsall.bat".vs2008 installed.
For the vcvarsall.bat error, see: http://stackoverflow.com/questions/2817869/error-unable-to-find-vcvarsall-bat
Hello,
I downloaded and built pyodbc on Redhat Linux, it built and installed fine. But now import pyodbc from python prompt fails with this error: ImportError?: No module named pyodbc
Can you please help? Thanks!
$ sudo apt-get install unixODBC-dev
$ sudo apt-get install g++
$ sudo apt-get install python-dev
$ sudo apt-get install tdsodbc
download and extract the odbc source code (http://code.google.com/p/pyodbc/downloads/detail?name=pyodbc-3.0.7.zip&can=2&q=)
run the setupfile in the extracted directory: python setup.py build sudo python setup.py install
I built and installed pyodbc (v. 3.0.7) on a system with python 2 and 3 installed. For the python 3 version, all I needed to do was to replace 'python' by 'python3' in the above commands: $ sudo apt-get install python3-dev $... sudo python3 pyodbc build sudo python3 pyodbc install This allows me to test gradually convert the necessary programs from python 2.x to python 3.
how can i compile the pyodbc3.0.6 for python 3.3 on a win7 system?there is a error message is "Unable to find vcvarsall.bat".vs2008 installed. http://wdfshare.blogspot.com
http://anekajaringmurah.blogspot.com/ http://pusatjaringmurah.blogspot.com/ http://anekajaringpengaman.blogspot.com/ http://agenjaringpengaman.blogspot.com/ http://jaringpengamanfutsal.blogspot.com/ http://jaring-pengamanmurah.blogspot.com/ http://jaringcenter.blogspot.com/ http://agenjaringjakata.blogspot.com/ http://jualjaringpengamanmurah.blogspot.com/ http://jaringsafetyjakarta.blogspot.com/ http://jaringpengaman-murah.blogspot.com/ http://jaringmurah.blogspot.com/ http://jaring-murah.blogspot.com/ http://jaringpengamanmurah.blogspot.com/ http://jaringbangunan.blogspot.com/ http://agenjaringsafety.blogspot.com/ http://sentral-jaring.blogspot.com/ http://sentraljaring.blogspot.com/ http://tokojaringpengaman.blogspot.com/ http://pusatjaringjakarta.blogspot.com/ http://tokojaringpengamanmurah.blogspot.com/ http://jualjaringsafetymurah.blogspot.com/ https://pancasamudera.wordpress.com/ https://pasangjaringfutsal.wordpress.com/ https://jualtambangmurah.wordpress.com/ https://tokojaring.wordpress.com/ https://jualjaringfutsal.wordpress.com/ https://jaringfutsal.wordpress.com/