6

I receive the following error when installing pymssql on OS X Yosemite 10.10.3 - has anyone gotten around the following error? I am using FreeTDS (v0.91.112) version 7.1 and Python 2.7.6 - the tsql utility connects to a SQL Database with no issue.

sudo pip install pymssql

Error:

Command "/usr/bin/python -c "import setuptools, tokenize;
__file__='/private/tmp/pip-build-T5Usla/pymssql/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n',
'\n'), __file__, 'exec'))" install --record /tmp/pip-uZGqK4-record/install-
record.txt --single-version-externally-managed --compile" failed with error
code 1 in /private/tmp/pip-build-T5Usla/pymssql
Mike Williamson
  • 4,915
  • 14
  • 67
  • 104
Joseph Idziorek
  • 4,853
  • 6
  • 23
  • 37
  • This error is pretty hard to read. – erip Jun 04 '15 at 14:36
  • That doesn't look like the real error, but instead a failure pip doesn't fully report when trying to delegate building to pymssql. I suggest you try & download pymssql as source distribution & build it yourself using `python setup.py build` - most likely that tells you more about the root cause. – deets Jun 04 '15 at 14:55

1 Answers1

13

You should be able to install pymmsql on your Mac for Azure SQL DB by following these three steps.

Step 1: Install Homebrew Go to your terminal and run the following command :

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Step 2 : Install FreeTDS. From the terminal run the following command :

brew install freetds

This should install freetds on your system

Step 3 : Install pymmsql. From the terminal run the following command

sudo -H pip install pymssql

Now you should be able to use pymssql to connect to Azure SQL DB and SQL Server.

meet-bhagdev
  • 2,608
  • 18
  • 22