- 错误代码如下:

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.

最新文章

  1. 自定义Chrome插件Vimium
  2. ADO总结测试数据库
  3. Can&#39;t connect to MySQL server on localhost (0)
  4. iOS开发-pod install 出错 The dependency `AFNetworking (~&gt; 2.6.0)` is not used in any concrete target.
  5. ACM算法总结及刷题参考
  6. ThinkPHP 中M方法和D方法详解----转载
  7. jsp页面 date转化成string
  8. [ActionScript 3.0] AS3虚线绘制方法
  9. div+css登陆界面案例2
  10. ios loading视图动画(模仿58同城)
  11. Android Studio 1.0 (稳定版) 完全攻略
  12. backtrack种子
  13. [译]ASP.NET Core 2.0 视图引擎
  14. win10下 github+hexo搭建个人博客.md
  15. nginx系列8:反向代理和负载均衡原理
  16. saltstack主机管理项目:编写插件基类-获取主机列表-提取yaml配置文件(四)
  17. 【Static Program Analysis - Chapter 3】Type Analysis
  18. 2101244 - FAQ: SAP HANA Multitenant Database Containers (MDC)
  19. 第六次spring会议
  20. LeetCode 917 Reverse Only Letters 解题报告

热门文章

  1. Docker 学习 1 入门
  2. KVM管理工具 WebVirtMgr
  3. url的分发
  4. 异数OS 2017 DPDK 峰会观后感
  5. 【转载】Notepad++源码分析
  6. 学习Python中遇到的各种错误
  7. Frameworks.Entity.Core 6 Specification
  8. Java多线程,对锁机制的进一步分析
  9. jQuery-01-jQuery选择器及元素操作
  10. 理解和运用Java中的Lambda