跑步时pip install pyodbc,我得到
pip install pyodbc
In file included from .../build/pyodbc/src/buffer.cpp:12: .../build/pyodbc/src/pyodbc.h:52:10: fatal error: 'sql.h' file not found #include <sql.h> ^ 1 error generated. error: command 'cc' failed with exit status 1
看来Mavericks在/ usr / include下没有sql.h
是否有人设法安装pyodbc?有已知的解决方法吗?
如您所见,OSX Mavericks删除了PyODBC编译所需的sql标头。按照以下步骤操作,可以安装PyODBC:
pip install --no-install pyodbc
cd [VIRTUAL_ENV]/build/pyodbc
python setup.py build_ext --include-dirs=[LIBIODBC_SOURCES]/include/
pip install --no-download pyodbc
Installing collected packages: pyodbc
Running setup.py install for pyodbc
warning: no files found matching 'tests/*'
Successfully installed pyodbc Cleaning up…
我也可以将文件复制[libiodbc_sources]/include/到我的文件中,/usr/include然后运行pip install pyodbc,但是我不想手动将文件添加到系统文件夹。
[libiodbc_sources]/include/
/usr/include