Question

I'm trying to compile pymssql for python 2.5. I'm doing this because I think the version of pymssql I have is compiled for python 2.4. This is the error I get which makes me think that:

/home/username/lib/python2.5/pymssql.py:30: RuntimeWarning: Python C API version mismatch for module _mssql: This Python has API version 1013, module _mssql has version 1012.
import _mssql

Anyway I'm on Ubuntu 10.10 and have installed python2.5 and python2.5-dev via the deadsnakes ppa. I've created an virtualenv with using python2.5 like so

mkvirtualenv pymssql -p /usr/bin/python2.5

I've install cython from pip and am trying to install pymssql from pip but am getting this error

Downloading/unpacking pymssql
  Running setup.py egg_info for package pymssql
Installing collected packages: pymssql
  Running setup.py install for pymssql
    building '_mssql' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/neil/virtualenv/pymssql/build/pymssql/freetds/nix_32/include -I/usr/include/python2.5 -c _mssql.c -o build/temp.linux-i686-2.5/_mssql.o -DMSDBLIB
    gcc: _mssql.c: No such file or directory
    gcc: no input files
    error: command 'gcc' failed with exit status 1
    Complete output from command /home/neil/virtualenv/pymssql/bin/python2.5 -c "import setuptools;__file__='/home/neil/virtualenv/pymssql/build/pymssql/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-cEGXRy-record/install-record.txt --install-headers /home/neil/virtualenv/pymssql/include/site/python2.5:
    running install

running build

running build_ext

building '_mssql' extension

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/neil/virtualenv/pymssql/build/pymssql/freetds/nix_32/include -I/usr/include/python2.5 -c _mssql.c -o build/temp.linux-i686-2.5/_mssql.o -DMSDBLIB

gcc: _mssql.c: No such file or directory

gcc: no input files

error: command 'gcc' failed with exit status 1

----------------------------------------
Command /home/neil/virtualenv/pymssql/bin/python2.5 -c "import setuptools;__file__='/home/neil/virtualenv/pymssql/build/pymssql/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-cEGXRy-record/install-record.txt --install-headers /home/neil/virtualenv/pymssql/include/site/python2.5 failed with error code 1
Storing complete log in /home/neil/.pip/pip.log

Any ideas how to resolve this?

Was it helpful?

Solution

Turns out I needed to install pyrex from pip.

pip install pyrex
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top