pypy中使用pymssql


前两天在python中使用了pymssql连接sqlserver 这个库本身需要freetds的支持 我已经安装 但是不知道需要如何配置 但是在python下安装并且使用成功了 但是效率上不太理想,于是想到在pypy中跑,但是pypy用pip_pypy install pymssql的时候出现了如下错误


 Collecting pymssql
  Using cached pymssql-2.1.1.tar.gz
    /usr/local/Cellar/pypy/2.4.0_2/libexec/site-packages/setuptools-11.3.1-py2.7.egg/pkg_resources/__init__.py:2510: PEP440Warning: 'setuptools (git-0.4.0)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
    /usr/local/Cellar/pypy/2.4.0_2/libexec/site-packages/setuptools-11.3.1-py2.7.egg/pkg_resources/__init__.py:2510: PEP440Warning: 'setuptools (git-0.4.1)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
    /usr/local/Cellar/pypy/2.4.0_2/libexec/site-packages/setuptools-11.3.1-py2.7.egg/pkg_resources/__init__.py:2510: PEP440Warning: 'setuptools (git-0.4.2)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
    /usr/local/Cellar/pypy/2.4.0_2/libexec/site-packages/setuptools-11.3.1-py2.7.egg/pkg_resources/__init__.py:2510: PEP440Warning: 'setuptools (git-1.0)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
    /usr/local/Cellar/pypy/2.4.0_2/libexec/site-packages/setuptools-11.3.1-py2.7.egg/pkg_resources/__init__.py:2510: PEP440Warning: 'setuptools (git-1.0b1)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
    /usr/local/Cellar/pypy/2.4.0_2/libexec/site-packages/setuptools-11.3.1-py2.7.egg/pkg_resources/__init__.py:2510: PEP440Warning: 'setuptools (git-1.1)' is being parsed as a legacy, non PEP 440, version. You may find odd behavior and sort order. In particular it will be sorted as less than 0.0. It is recommend to migrate to PEP 440 compatible versions.
    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', '/opt/local/include']
    setup.py: library_dirs = ['/usr/local/lib', '/opt/local/lib']
    Installed /private/var/folders/ym/s67hnlcj3pg925x9c55y6y6r0000gn/T/pip-build-loEByS/pymssql/.eggs/setuptools_git-1.1-py2.7.egg
Installing collected packages: pymssql
  Running setup.py install for pymssql
    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', '/opt/local/include']
    setup.py: library_dirs = ['/usr/local/lib', '/opt/local/lib']
    building '_mssql' extension
    cc -arch x86_64 -O2 -fPIC -Wimplicit -I/usr/local/include -I/opt/local/include -I/usr/local/Cellar/pypy/2.4.0_2/libexec/include -c _mssql.c -o build/temp.macosx-10.10-x86_64-2.7/_mssql.o -DMSDBLIB
    _mssql.c:708:3: error: unknown type name 'PyBaseExceptionObject'
      PyBaseExceptionObject __pyx_base;
      ^
    _mssql.c:21412:99: error: use of undeclared identifier 'PyBaseExceptionObject'
      __pyx_ptype_6_mssql_Exception = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "Exception", sizeof(PyBaseExceptionObject), 0); if (unlikely(!__pyx_ptype_6_mssql_Exception)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                      ^
    2 errors generated.
    error: command 'cc' failed with exit status 1
    Complete output from command /usr/local/Cellar/pypy/2.4.0_2/bin/pypy -c "import setuptools, tokenize;__file__='/var/folders/ym/s67hnlcj3pg925x9c55y6y6r0000gn/T/pip-build-loEByS/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/ym/s67hnlcj3pg925x9c55y6y6r0000gn/T/pip-HTZYKT-record/install-record.txt --single-version-externally-managed --compile:
    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', '/opt/local/include']

    setup.py: library_dirs = ['/usr/local/lib', '/opt/local/lib']

    running install

    running build

    running build_ext

    building '_mssql' extension

    creating build

    creating build/temp.macosx-10.10-x86_64-2.7

    cc -arch x86_64 -O2 -fPIC -Wimplicit -I/usr/local/include -I/opt/local/include -I/usr/local/Cellar/pypy/2.4.0_2/libexec/include -c _mssql.c -o build/temp.macosx-10.10-x86_64-2.7/_mssql.o -DMSDBLIB

    _mssql.c:708:3: error: unknown type name 'PyBaseExceptionObject'

      PyBaseExceptionObject __pyx_base;

      ^

    _mssql.c:21412:99: error: use of undeclared identifier 'PyBaseExceptionObject'

      __pyx_ptype_6_mssql_Exception = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "Exception", sizeof(PyBaseExceptionObject), 0); if (unlikely(!__pyx_ptype_6_mssql_Exception)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

                                                                                                      ^

    2 errors generated.

    error: command 'cc' failed with exit status 1

    ----------------------------------------


     Command "/usr/local/Cellar/pypy/2.4.0_2/bin/pypy -c "import setuptools, tokenize;__file__='/var/folders/ym/s67hnlcj3pg925x9c55y6y6r0000gn/T/pip-build-loEByS/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/ym/s67hnlcj3pg925x9c55y6y6r0000gn/T/pip-HTZYKT-record/install-record.txt
    --single-version-externally-managed --compile" failed with error code 1 in /var/folders/ym/s67hnlcj3pg925x9c55y6y6r0000gn/T/pip-build-loEByS/pymssql

pypy python2.7 pymssql freetds

露米娅斯卡雷特 10 years, 1 month ago

Your Answer