CentOS运行Py脚本报错illegal instruction故障处理

测试Python脚本运行环境及依赖

[root@localhost network]# python3 devops_ping_test1.py 
Illegal instruction

①、illegal instruction报错

由于本人第一次测试时运行是正常的,但是在测试过程中多次修改、覆盖代码运行后提示Illegal instruction(非法指令),所以不能单纯的用网上搜索的关于CPU架构等硬件环境问题的排错思路。

②、报错原因

Python第三方库兼容性问题

通过引入的第三方库来逐一定位

[root@localhost network]# python3
Python 3.12.0 (main, Mar 29 2024, 16:32:01) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> import openpyxl
Illegal instruction

[root@localhost network]# python3
Python 3.12.0 (main, Mar 29 2024, 16:32:01) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pythoning
Traceback (most rece

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-05 09:08:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-05 09:08:01       101 阅读
  3. 在Django里面运行非项目文件

    2024-04-05 09:08:01       82 阅读
  4. Python语言-面向对象

    2024-04-05 09:08:01       91 阅读

热门阅读

  1. Spring 自定义接口参数解析器

    2024-04-05 09:08:01       31 阅读
  2. Linux下I2C设备驱动:I2C设备和驱动匹配过程

    2024-04-05 09:08:01       37 阅读
  3. DPDK系列之四十二DPDK应用网络编程UDP编程

    2024-04-05 09:08:01       28 阅读
  4. K8s svc失效

    2024-04-05 09:08:01       27 阅读
  5. MongoDB聚合运算符:$maxN(用于数组)

    2024-04-05 09:08:01       28 阅读
  6. LeetCode-热题100:55. 跳跃游戏

    2024-04-05 09:08:01       34 阅读
  7. redis分布式锁

    2024-04-05 09:08:01       27 阅读
  8. 什么是CSS编程语言?怎么使用?

    2024-04-05 09:08:01       35 阅读
  9. 【leetcode面试经典150题】9.跳跃游戏(C++)

    2024-04-05 09:08:01       31 阅读
  10. tomcat 常用的一些配置

    2024-04-05 09:08:01       26 阅读