Gcc: _mssql.c: No such file or directory

I am trying to compile pymssql for python 2.5. I do this because I think the version of pymssql that I have compiled for python 2.4. This is the error I get that 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 installed python2.5 and python2.5-dev via deadsnakes ppa . I created virtualenv using python2.5 so that

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

I installed cython from pip and trying to install pymssql from pip but 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 solve this problem?

+5
source share
1 answer

Turns out I needed to install pyrex from pip.

pip install pyrex
+5
source

All Articles