当前位置: 首页 > 面试题库 >

mac-pip安装pymssql错误

姚智
2023-03-14
问题内容

我使用Mac(OS X 10.11.5)。我想pymssql为python安装模块。在Terminal.app我输入sudo -H pip install pymssqlpip install pymssqlsudo pip install pymssql。但是会发生错误。

该目录/Users/janghyunsoo/Library/Caches/pip/http或其父目录不属于当前用户,并且缓存已被禁用。请检查该目录的权限和所有者。如果执行pipsudo,你可能想sudo-H标志。

该目录/Users/janghyunsoo/Library/Caches/pip或其父目录不属于当前用户,并且缓存轮已被禁用。检查该目录的权限和所有者。如果执行pipsudo,你可能想sudo-H标志。

Collecting pymssql
  Downloading pymssql-2.1.2.tar.gz (898kB)
    100% |████████████████████████████████| 901kB 955kB/s 
Installing collected packages: pymssql
  Running setup.py install for pymssql ... error
    Complete output from command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-KA5ksi/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-A3wRBy-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', '/opt/local/include/freetds']
    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.6-intel-2.7
    /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/opt/local/include -I/opt/local/include/freetds -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mssql.c -o build/temp.macosx-10.6-intel-2.7/_mssql.o -DMSDBLIB
    _mssql.c:18924:15: error: use of undeclared identifier 'DBVERSION_80'
        __pyx_r = DBVERSION_80;
                  ^
    1 error generated.
    error: command '/usr/bin/clang' failed with exit status 1

    ----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-KA5ksi/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-A3wRBy-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-KA5ksi/pymssql/

问题答案:

在运行pip安装之前,我可以通过Homebrew恢复到较旧版本的FreeTDS来解决此问题。

brew unlink freetds; brew install homebrew/versions/freetds091

解决方案由andrewmwhite在以下位置找到:https
:
//github.com/pymssql/pymssql/issues/432



 类似资料:
  • 在Mac上安装了Python 3.5.1。当我试图从Python的标准库(如pip install BeautifulSoup)下载模块时,我收到以下错误: 使用缓存的BeautifulSoup-3.2.1。焦油gz从命令python安装程序完成输出。py egg_info:Traceback(最后一次调用):文件“”,第1行,在文件“/private/var/folders/bz/2h0jcnq

  • 我刚刚在我的MAC(约塞米蒂)上安装了Python3.4.3。我需要安装几个lxml,但是每次输入:pip install/“”/时,我都会得到错误消息。我已经遵循了多个教程,并且安装了pip。MAC已经有Python2.7.,但我安装了3.4.3。版本,不确定这是否是问题所在。错误消息为: brunos-macbook-pro:~brunopaesleme$pip install/macinto

  • 问题内容: 我从网站安装了MySQL和Workbench。我有一个Django项目,其requirements.txt: 当我跑步时 我出错了。为了解决这个问题,我跑了 现在抛出 为什么会这样呢? 更新:以下波纹管解决方案引发: 问题答案: 请尝试: 如果不起作用:首先安装 mysql-connector-c 如果您使用的是Windows: https://dev.mysql.com/downlo

  • 我正在执行< code > pip install setup tools-upgrade ,但出现以下错误 我错过了什么?我也尝试了sudo pip安装,但没有帮助。

  • Python 和系统版本支持列表 pip 可以在以下版本的 CPython 下运行:2.6, 2.7, 3.1, 3.2, 3.3, 3.4 和 pypy. pip 可以在 Unix/Linux, OS X 和 Windows 系统中运行. Note Python 2.5在 v1.3.1版本后支持, Python 2.4在v1.1版本后支持. 使用脚本安装和升级pip 要安装或升级pip,需要下载

  • 问题内容: 我为Django 1.9项目创建了virtualenv。我试图通过pip安装mysqlclient或mysql-python,但它们都给我错误。 两者都给我相同的错误信息: 命令“ python setup.py egg_info”在/ private / var / folders / r4 / bkv_4t9s4r140pjkgv6lsq8w0000gn / T / pip-bui