- 错误代码如下:

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. 你还不会Git?那就不要写代码了(二)

    Git 命令练习 git的删除,添加,修改与日志 which vi 查看命令的目录 ⌃ a 光标去开头 ⌃ E 光标去结尾 ehco 'hellow world asd' > test.txt ...

  2. TCP/IP协议与HTTP协议(二)

    TCP/IP协议是传输层协议,主要解决数据如何在网络中传输,而HTTP是应用层协议,主要解决如何包装数据. 1.TCP连接 手机能够使用联网功能是因为手机底层实现了TCP/IP协议,可以使手机终端通过 ...

  3. Replacing the deprecated Java JPEG classes for Java 7

    [src: https://blog.idrsolutions.com/2012/05/replacing-the-deprecated-java-jpeg-classes-for-java-7/] ...

  4. numpy基本知识

    """np.arrayobject 数组或嵌套的数列dtype 数组元素的数据类型,可选copy 对象是否需要复制,可选order 创建数组的样式,C为行方向,F为列方向 ...

  5. 玩转Django2.0---Django笔记建站基础十二(Django项目上线部署)

    第十二章 Django项目上线部署 目前部署Django项目有两种主流方案:Nginx+uWsGI+Django或者Apache+uWSGI+Django.Nginx作为服务器最前端,负责接收浏览器的 ...

  6. quick-cocos2d-x项目《狂点小怪兽》总结

    最近找了个公司实习,领导让我把公司的<狂点小怪兽>C++游戏用Lua重写.大概用了一个星期完成. 第一次使用quick-cocos2d-x,磕磕碰碰的也算是走了一遍流程. 1. quick ...

  7. .NET Core微服务二:Ocelot API网关

    .NET Core微服务一:Consul服务中心 .NET Core微服务二:Ocelot API网关 .NET Core微服务三:polly熔断与降级 本文的项目代码,在文章结尾处可以下载. 本文使 ...

  8. socket 原理

    socket 原理 什么是socket 我们知道进程通信的方法有管道.命名管道.信号.消息队列.共享内存.信号量,这些方法都要求通信的两个进程位于同一个主机.但是如果通信双方不在同一个主机又该如何进行 ...

  9. Spring整合Spring-data-jpa项目所遇到的坑

    1.异常信息: 错误原因:缺少spring-aop包 解决: <dependency> <groupId>org.springframework</groupId> ...

  10. Ubuntu安装openjdk8

    sudo apt-get update sudo apt-get install openjdk-8-jdk 通过 which java 找到java安装路径 添加环境变量 sudo vim ~/.b ...