ai didi

python - 如何在 MacOS Sierra 上安装 pymssql

转载 作者:太空狗 更新时间:2023-10-29 17:52:48 24 4
gpt4 key购买 nike

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-J1I0ox/pymssql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qmtdBW-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-J1I0ox/pymssql/

我遇到与显示相同的错误 here .我按照该页面上的说明尝试 brew install freetds 然后是 sudo -H pip install pymssql

生成此错误代码:

    _mssql.c:18814:15: error: use of undeclared identifier 'DBVERSION_80'
__pyx_r = DBVERSION_80;
^
4 warnings and 1 error generated.
error: command 'cc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-J1I0ox/pymssql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qmtdBW-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-J1I0ox/pymssql/

搜索此错误将我带到 this page .我按照那里发布的解决方案尝试了 brew unlink freetds; brew install homebrew/versions/freetds091 brew uninstall freetds; brew install homebrew/versions/freetds091 在尝试 sudo -H pip install pymssql 时会产生不同的错误:

_mssql.c:266:10: fatal error: 'sqlfront.h' file not found
#include "sqlfront.h"
^
1 error generated.
error: command 'cc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/_s/27xppw4j3yl78c9l4v1w3n9m0000gn/T/pip-build-97A9sQ/pymssql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/_s/27xppw4j3yl78c9l4v1w3n9m0000gn/T/pip-0nUZo4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/_s/27xppw4j3yl78c9l4v1w3n9m0000gn/T/pip-build-97A9sQ/pymssql/

于是我放弃并尝试安装 pyodbc,但我仍然遇到类似的错误: src/pyodbc.h:56:10: fatal error: 'sql.h' file not found
#include sql.h

任何帮助都会很棒。

最佳答案

This link 最终解决了我的问题。对于遇到这些问题的任何其他人,这一系列命令对我有用。

brew uninstall --force freetds
brew install freetds@0.91
brew link --force freetds@0.91
pip install pymssql

关于python - 如何在 MacOS Sierra 上安装 pymssql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44958536/

24 4 0
文章推荐: Angular2 路由 : How do I use [routerLink] within a
文章推荐: javascript - 哪个是 Angular2/Typescript For Windows 的最佳 IDE
文章推荐: Angular 2获取路线没有路线提供者
文章推荐: python - 哪个版本的 python 为 for 循环添加了 else 子句?
太空狗
个人简介

我是一名优秀的程序员,十分优秀!

滴滴打车优惠券免费领取
滴滴打车优惠券
全站热门文章
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com