简体   繁体   English

在Mac OS X Yosemite上安装pymssql时出错

[英]Error Installing pymssql on Mac OS X Yosemite

I receive the following error when installing pymssql on OS X Yosemite 10.10.3 - has anyone gotten around the following error? 在OS X Yosemite 10.10.3上安装pymssql时收到以下错误 - 有没有人得到以下错误? 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. 我使用FreeTDS(v0.91.112)版本7.1和Python 2.7.6 - tsql实用程序连接到SQL数据库没有问题。

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

You should be able to install pymmsql on your Mac for Azure SQL DB by following these three steps. 您应该能够通过以下三个步骤在Mac上为Azure SQL DB安装pymmsql。

Step 1: Install Homebrew Go to your terminal and run the following command : 步骤1:安装Homebrew Go到您的终端并运行以下命令:

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

Step 2 : Install FreeTDS. 第2步:安装FreeTDS。 From the terminal run the following command : 从终端运行以下命令:

brew install freetds

This should install freetds on your system 这应该在您的系统上安装freetds

Step 3 : Install pymmsql. 第3步:安装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. 现在,您应该能够使用pymssql连接到Azure SQL DB和SQL Server。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM