简体   繁体   English

定制安装pyodbc

[英]customized installation of pyodbc

I've encountered a tricky problem here. 我在这里遇到了一个棘手的问题。 The situation is: 情况是:

I want to compile pyodbc by using 我想通过使用编译pyodbc

    python setup.py install

under Linux 12. However, I get the following error 在Linux 12下。但是,出现以下错误

    fatal error: sql.h: No such file or directory compilation terminated.
    error: command 'gcc' failed with exit status 1

I guess it looks for unixODBC so I try to install it. 我猜它正在寻找unixODBC,所以我尝试安装它。 But the problem is, I do not have privilege to the root directory, so I have installed it in my home directory. 但是问题是,我没有权限访问根目录,因此已将其安装在主目录中。

My question then, is how can I redirect the pyodbc to look for my customized unixODBC path? 那么我的问题是,如何重定向pyodbc以查找我的自定义unixODBC路径?

Thank you in advance. 先感谢您。

Download the source from https://github.com/mkleehammer/pyodbc and run https://github.com/mkleehammer/pyodbc下载源代码并运行

python setup.py build_ext install -L/your/libpython/path/

or create a setup.cfg file containing 或创建一个setup.cfg文件,其中包含

[build_ext]
library_dirs="/your/libpython/path/"

then run 然后跑

python setup build_ext install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM