Recently I was trying to
pip install pymssql on Centos 7, but was hitting:
_mssql.c:266:22: fatal error: sqlfront.h: No such file or directory
That error happened when pip tried to compile the driver after it had downloaded the relevant files.
The issue was due to the libraries
freetds-devel not being installed on the system. I tried to yum install them with
sudo yum install -y freetds and
sudo yum install -y freetds-devel but yum couldn’t find them in its built in repos, and just displayed
No package freetds available. I ended up locating the rpm files on pkgs.org and installing them manually. Before that would work however, I also had to install the
epel package (extra package for Enterprise Linux). The full set of commands I ran were:
$ sudo yum install -y epel-release $ wget "http://download-ib01.fedoraproject.org/pub/"` `"epel/7/x86_64/Packages/f/freetds-0.95.81-1.el7.x86_64.rpm" $ sudo yum install -y freetds-0.95.81-1.el7.x86_64.rpm $ wget "http://download-ib01.fedoraproject.org/pub/epel/"` `"7/x86_64/Packages/f/freetds-devel-0.95.81-1.el7.x86_64.rpm" $ sudo yum install -y freetds-devel-0.95.81-1.el7.x86_64.rpm
After that, running
pip install pymssql worked fine.