mac - pip install pymssql error

前端 未结 7 837
执笔经年
执笔经年 2020-12-05 02:40

I use Mac (OS X 10.11.5). I want to install module pymssql for python. In Terminal.app, I input sudo -H pip install pymssql, pip

7条回答
  •  渐次进展
    2020-12-05 03:12

    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)

提交回复
热议问题