zoukankan      html  css  js  c++  java
  • Linux学习32

    报错描述

    pip3 安装 mysqlclient 的时候,出现报错 _mysql.c:32:20: fatal error: Python.h: No such file or directory

    pip3 install mysqlclient==1.3.12
    

    报错内容

      _mysql.c:32:20: fatal error: Python.h: No such file or directory
         #include "Python.h"
                            ^
        compilation terminated.
        error: command 'gcc' failed with exit status 1
    
    

    解决思路

    刚开始看到command 'gcc' failed还以为是缺少gcc编译包,于是yum安装gcc相关

    yum install gcc gcc-c++ kernel-devel
    

    安装完成后依然报错,于是搜索:_mysql.c:32:20: fatal error: Python.h: No such file or directory 发现是缺少 python3-devel
    centos 系统

    • python2版本执行:sudo yum install python-devel
    • python3版本执行:sudo yum install python3-devel

    Ubuntu,Debian系统

    • python2版本执行:sudo apt-get install python-dev
    • python3版本执行:sudo apt-get install python3-dev

    安装 python3-devel 依赖后,重新执行就解决了

  • 相关阅读:
    监听器
    过滤器
    连接池与分页
    jdbc优化
    jdbc入门
    web开发mysql基础
    自定义标签
    jsp基础
    会话管理入门
    19. Remove Nth Node From End of List C++删除链表的倒数第N个节点
  • 原文地址:https://www.cnblogs.com/yoyoketang/p/15256577.html
Copyright © 2011-2022 走看看