转~~Python:ModuleNotFoundError: No module named 模块名 错误及解决方案

发布时间 2023-09-21 17:23:50作者: 猪大大BiuBiuBiu

IDE中语法检查,运行都正常,Linux命令行远程运行就报错:

参考文档:

https://blog.csdn.net/SeaSky_Steven/article/details/106426985

 

1 print(os.pardir)
2 sys.path.append(os.pardir)
3 
4 '''
5 os模块负责程序与操作系统的交互,提供了访问操作系统底层的接口;
6 sys模块负责程序与python解释器的交互,提供了一系列的函数和变量,用于操控python的"运行时环境"