mac - pip install pymssql error

回眸只為那壹抹淺笑 提交于 2019-11-27 19:02:05

I was able to work around this by reverting to an older version of FreeTDS through Homebrew before running the pip install.

brew unlink freetds; brew install homebrew/versions/freetds091

The solution was found by andrewmwhite at: https://github.com/pymssql/pymssql/issues/432

The top voted solution did not work for me as brew did not link the older version of freetds on its own. I did this to solve the problem:

brew unlink freetds; 
brew install freetds@0.91;
brew link --force freetds@0.91
Himanshu dua

Found Detailed and simple answer with step by step installation of pymssql on http://gree2.github.io/python/setup/2017/04/19/python-instal-pymssql-on-mac.

  1. brew unlink freetds; brew install homebrew/core/freetds091
  2. brew link --force freetds@0.91
  3. pip install pymssql

"brew install homebrew/python/pymssql" also worked but will install older 2.1.1 as of today.

Found a solution for pip/python2 & pip3/python3

Problem:

I was Unable to get a successful build from pip3 following @siva & @himanshu workaround works for python2 but not for python3.

pip3 install pymssql

    ..._mssql.c:21155:15: error: use of undeclared identifier 'DBVERSION_80'
        __pyx_r = DBVERSION_80;
                  ^
    1 error generated.
    error: command 'clang' failed with exit status 1

Your issue is not a permission issue, but, a code-compiling issue with dependent code for pymssql.

Here's the discussion, Where I found the Solution on github.

It has been around for a while at this point, just placing here for visibility.

Just use the newest build of pymssql from gitub:

    pip3 install git+https://github.com/pymssql/pymssql

Also works for python2

    pip install git+https://github.com/pymssql/pymssql

OR

    pip2 install git+https://github.com/pymssql/pymssql

I Tested on Mac OS X (10.13.6) & Homebrew (1.7.1-62-gddbefee) multiple times. The command works for both versions of freetds (0.91) or (1.00.94)

This worked for me on mac:

pip install cython

then

pip install git+https://github.com/pymssql/pymssql.git
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!