Centos 7: No package freetds available

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 and 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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s