- 错误代码如下:

pip install pyodbc
Looking in indexes: http://172.16.1.250/repository/douban/simple
Collecting pyodbc
Downloading http://172.16.1.250/repository/douban/packages/31/14/124da4b15df927c8a9192c44a42523e289e5a815acd437fd5ce5c2cbc515/pyodbc-4.0.28.tar.gz (264 kB)
|████████████████████████████████| kB 38.4 MB/s
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
ERROR: Command errored out with exit status :
command: /root/.pyenv/versions/3.7./envs/flask-env-3.7./bin/python3. -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v979njx5/pyodbc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v979njx5/pyodbc/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-record-68v8gv98/install-record.txt --single-version-externally-managed --compile --install-headers /root/.pyenv/versions/3.7./envs/flask-env-3.7./include/site/python3./pyodbc
cwd: /tmp/pip-install-v979njx5/pyodbc/
Complete output ( lines):
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPYODBC_VERSION=4.0. -I/root/.pyenv/versions/3.7./envs/flask-env-3.7./include -I/root/.pyenv/versions/3.7./include/python3.7m -c src/buffer.cpp -o build/temp.linux-x86_64-3.7/src/buffer.o -Wno-write-strings
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status
----------------------------------------
ERROR: Command errored out with exit status : /root/.pyenv/versions/3.7./envs/flask-env-3.7./bin/python3. -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-v979njx5/pyodbc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-v979njx5/pyodbc/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-record-68v8gv98/install-record.txt --single-version-externally-managed --compile --install-headers /root/.pyenv/versions/3.7./envs/flask-env-3.7./include/site/python3./pyodbc Check the logs for full command output.

- 安装 gcc-c-c++

yum install -y gcc-c++

- 继续报错

(flask-env-3.7.) [root@controller flask-env-3.7.]# pip3 install pyodbc
Looking in indexes: http://172.16.1.250/repository/douban/simple
Collecting pyodbc
Downloading http://172.16.1.250/repository/douban/packages/31/14/124da4b15df927c8a9192c44a42523e289e5a815acd437fd5ce5c2cbc515/pyodbc-4.0.28.tar.gz (264 kB)
|████████████████████████████████| kB 52.1 MB/s
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
ERROR: Command errored out with exit status :
command: /root/.pyenv/versions/3.7./envs/flask-env-3.7./bin/python3. -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ks9xm6sj/pyodbc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ks9xm6sj/pyodbc/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-record-5nfyd0a8/install-record.txt --single-version-externally-managed --compile --install-headers /root/.pyenv/versions/3.7./envs/flask-env-3.7./include/site/python3./pyodbc
cwd: /tmp/pip-install-ks9xm6sj/pyodbc/
Complete output ( lines):
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPYODBC_VERSION=4.0. -I/root/.pyenv/versions/3.7./envs/flask-env-3.7./include -I/root/.pyenv/versions/3.7./include/python3.7m -c src/buffer.cpp -o build/temp.linux-x86_64-3.7/src/buffer.o -Wno-write-strings
In file included from src/buffer.cpp:::
src/pyodbc.h::: fatal error: sql.h: No such file or directory
#include <sql.h>
^
compilation terminated.
error: command 'gcc' failed with exit status
----------------------------------------
ERROR: Command errored out with exit status : /root/.pyenv/versions/3.7./envs/flask-env-3.7./bin/python3. -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ks9xm6sj/pyodbc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ks9xm6sj/pyodbc/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-record-5nfyd0a8/install-record.txt --single-version-externally-managed --compile --install-headers /root/.pyenv/versions/3.7./envs/flask-env-3.7./include/site/python3./pyodbc Check the logs for full command output.

- 安装 unixODBC-devel

yum install -y unixODBC-devel

- 完美解决

(flask-env-3.7.) [root@controller flask-env-3.7.]# pip3 install pyodbc
Looking in indexes: http://172.16.1.250/repository/douban/simple
Collecting pyodbc
Downloading http://172.16.1.250/repository/douban/packages/31/14/124da4b15df927c8a9192c44a42523e289e5a815acd437fd5ce5c2cbc515/pyodbc-4.0.28.tar.gz (264 kB)
|████████████████████████████████| kB 21.1 MB/s
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... done
Successfully installed pyodbc-4.0.

[ERROR]pip insall pyodbc的更多相关文章

  1. pip 安装 lxml 出错

    用pip安装 lxml 老是出错,在公司安装了 wheel,从 http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml 下载了lxml的whl包,pip ins ...

  2. Ubuntu12.10下Python(pyodbc)访问SQL Server解决方案

    一.基本原理 请查看这个网址,讲得灰常详细:http://www.jeffkit.info/2010/01/476/   二.实现步骤 1.安装linux下SQL Server的驱动程序 安装Free ...

  3. robotframwork数据库测试(一)——pymysql与pyodbc

    本章节仅总结一下使用pymysql与pyodbc链接MySQL数据库. 2个都可以链接mysql数据,进行增删改查.但是呢,使用pyodbc操作数据库,对中文支持度好一些.pymysql则需要处理一下 ...

  4. Python3.x:pyodbc连接Sybase数据库操作(Windows系统下DNS模式)

    Python3.x:pyodbc连接Sybase数据库操作(Windows系统下DNS模式) 一.安装模块pyodbc pip install pyodbc 二.配置odbc数据源 (1).windo ...

  5. pyodbc连接MySQL数据库

    1:Python安装pyodbc:pip install pyodbc 2:安装unixODBC-2.3.4.tar.gz ./configure make make install 3:下载基于py ...

  6. python相关——如何安装pip

    今天在新的一台电脑上安装了pip.流程有点忘记了,在这里再次记录下来. 本教程基于python3.4,并且需要连接互联网,总共需要两步. 1.要安装pip,首先要安装setuptools,链接:htt ...

  7. python使用pip安装第三方模块遇到的问题及解决方法

    python使用pip安装第三方模块遇到的问题及解决方法 关注公众号"轻松学编程"了解更多. 使用国内源: 清华:https://pypi.tuna.tsinghua.edu.cn ...

  8. win10下安装scrapy出现错误的处理

    一.背景: 在win10的dos窗口下使用命令pip install scrapy安装scrapy时,出现“ error: Microsoft Visual C++ 14.0 is required. ...

  9. MySQL ODBC for Linux

    参考自http://blog.csdn.net/allens_zhou/article/details/8575400 centos7 64bit [IP:192.168.0.100] yum ins ...

随机推荐

  1. NPOI读取Excel的数据

    首先是给项目安装NPOI.DLL :Install-Package NPOI -Version 2.4.1 HttpPostedFile upLoadPostFile = FileUpload1.Po ...

  2. .NET绘制旋转太极图

    .NET绘制旋转太极图 我之前发了一篇<用.NET写"算命"程序>的文章,但有人纷纷提出了质疑,认为没有"科学"(mi xin)依据

  3. 关于后缀间$LCP$的一些公式的证明

    目录 关于\(LCP\)有如下两个公式: \(LCP~Lemma\) 的证明: \(LCP~Theorem\) 的证明: 关于\(LCP\)有如下两个公式: \(LCP~Lemma:\) 对任意 \( ...

  4. 提高开发效率的一些ipython技巧

    目录 一.显示ipython快速参考 二.书签功能 三.查看帮助或信息 四.执行python程序 五.执行剪贴板中的代码 六.与操作系统交互 七.测试代码执行时间 八.性能分析 九.matplotli ...

  5. rabbitmq 实现延迟队列的两种方式

    原文地址:https://blog.csdn.net/u014308482/article/details/53036770 ps: 文章里面延迟队列=延时队列 什么是延迟队列 延迟队列存储的对象肯定 ...

  6. 【转载】Notepad++源码分析

    在网上发现了一个哥们写了关于Notepad++源码的文章,不过就写了一就没有了,我就接着他的工作再说说吧! 大三了,也写了一点儿程序了,但是如果只是按照自己的思路写下去恐怕难以提高,于是准备开始阅读一 ...

  7. Spring-事务(1)

    一,注解的方式实现事务 1.Dao层 package com.atguigu.spring.tx; public interface BookShopDao { //根据书号获取书的单价 public ...

  8. 19_08_26校内训练[Max]

    题意 求$max_{l \leq r}{\{min{\{a_l,a_{l+1},...,a_r\}}*(r-l+1)\}}$ 思考 分治,考虑一个区间跨过某个点的贡献即可. 代码 #include&l ...

  9. Web自动化测试项目搭建目录

    Web自动化测试项目搭建(一) 需求与设计 Web自动化测试项目(二)BasePage实现 Web自动化测试项目(三)用例的组织与运行 Web自动化测试项目(四)测试报告 Web自动化测试项目(五)测 ...

  10. 【WPF学习】第二十六章 Application类——应用程序的生命周期

    在WPF中,应用程序会经历简单的生命周期.在应用程序启动后,将立即创建应用程序对象,在应用程序运行时触发各种应用程序事件,你可以选择监视其中的某些事件.最后,当释放应用程序对象时,应用程序将结束. 一 ...