测试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