mac 安装pymssql

pip install pymssql

报错如下:

ERROR: Complete output from command /usr/local/bin/python3 /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/nq/vbqg55sx3rvc9yql91v1vm800000gn/T/tmpzajp6qzi:
    
    setup.py: platform.system() => 'Darwin'
    setup.py: platform.architecture() => ('64bit', '')
    setup.py: platform.libc_ver() => ('', '')
    setup.py: Detected Darwin/Mac OS X.
        You can install FreeTDS with Homebrew or MacPorts, or by downloading
        and compiling it yourself.
    
        Homebrew (http://brew.sh/)
        --------------------------
        brew install freetds
    
        MacPorts (http://www.macports.org/)
        -----------------------------------
        sudo port install freetds
    
    setup.py: Not using bundled FreeTDS
    setup.py: include_dirs = ['/usr/local/include']
    setup.py: library_dirs = ['/usr/local/lib']
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/nq/vbqg55sx3rvc9yql91v1vm800000gn/T/pip-install-u6ouv906/pymssql/

解决:

1. 安装freetds,老版本的0.91已经弃用了,查看github的最新版本https://github.com/FreeTDS/freetds,当前最新为1.1版本。

brew install [email protected]

2. 通过使用github安装pymssql。

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

结果:

Collecting git+https://github.com/pymssql/pymssql.git
  Cloning https://github.com/pymssql/pymssql.git to /private/var/folders/nq/vbqg55sx3rvc9yql91v1vm800000gn/T/pip-req-build-tbpq5rzu
  Running command git clone -q https://github.com/pymssql/pymssql.git /private/var/folders/nq/vbqg55sx3rvc9yql91v1vm800000gn/T/pip-req-build-tbpq5rzu
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: pymssql
  Building wheel for pymssql (PEP 517) ... done
  Stored in directory: /private/var/folders/nq/vbqg55sx3rvc9yql91v1vm800000gn/T/pip-ephem-wheel-cache-t3di1db0/wheels/2b/cf/8e/79bd55ed1594fe1ad30c4e5c75b81a7bacfd2c4002455e3250
Successfully built pymssql
Installing collected packages: pymssql
Successfully installed pymssql-2.1.4

小功告成。

 

 

你可能感兴趣的:(数据库,sql,server)